Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main entry point to package.json #305

Closed
wwilsman opened this issue Feb 25, 2018 · 7 comments · Fixed by #306
Closed

Add main entry point to package.json #305

wwilsman opened this issue Feb 25, 2018 · 7 comments · Fixed by #306

Comments

@wwilsman
Copy link

wwilsman commented Feb 25, 2018

I'm submitting a bug report

Webpack version:
4.0.0

Webpack Karma version:
2.0.10

Karma version:
2.0.0

Current behavior:
With 56e99b0 the index was moved to src. Since the index is no longer at the root of this package, the main property of package.json needs to be updated to lib (where the index eventually ends up).

Without updating the entry point, karma cannot find the module. require('karma-webpack') also is unable to find the entry point.

Expected/desired behavior:
Karma and require should be able to find the module's entry point

@wwilsman
Copy link
Author

wwilsman commented Feb 25, 2018

As a workaround, this fixes the issue:

plugins: [
  'karma-webpack/lib'
]

@michael-ciniawsky
Copy link
Contributor

#306 Should fix it, could someone quickly confirm by manually adding it to in node_modules ?

@dfederm
Copy link

dfederm commented Feb 25, 2018

For others who might be running into this issue, it manifests like this:

25 02 2018 15:05:45.726:ERROR [plugin]: Cannot find plugin "...\node_modules/karma-webpack".
  Did you forget to install it?
  npm install ...\node_modules/karma-webpack --save-dev
25 02 2018 15:05:45.731:ERROR [preprocess]: Can not load "webpack", it is not registered!
  Perhaps you are missing some plugin?

@wwilsman's mitigation works just fine for now, but note that you'll have to manually add all karma-* plugins to the list which you might be using (eg. karma-chrome-launcher, karma-jasmine, etc.)

@dfederm
Copy link

dfederm commented Feb 25, 2018

@michael-ciniawsky Can confirm. Made the change locally and it seems to have fixed the issue.

@michael-ciniawsky
Copy link
Contributor

Just a sec cutting a release :)

@wwilsman
Copy link
Author

Thanks for the quick turnaround guys!

@michael-ciniawsky
Copy link
Contributor

Released in v2.0.11 🎉

@michael-ciniawsky michael-ciniawsky modified the milestones: 2.0.11, 2.0.12 Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants