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

Error: No provider for {variable name} #146

Closed
jambonrose opened this issue Jul 26, 2016 · 3 comments · Fixed by #147
Closed

Error: No provider for {variable name} #146

jambonrose opened this issue Jul 26, 2016 · 3 comments · Fixed by #147

Comments

@jambonrose
Copy link
Contributor

Bug Report for Webpack v2.1.0-beta using master branch of karma-webpack. Error replicated in Karma 0.13.22 and 1.1.1 on macOS 10.11.5 with npm 3.8.8 and node v5.11.0 (error seen on TravisCI as well, but not replicated).

We can no longer run tests using the setup above. When I try to run tests on the setup above, karma exits with:

25 07 2016 18:48:25.339:WARN [preprocess]: Can not load "webpack"!
  Error: No provider for "webpackOptions"! (Resolving: preprocess -> preprocessor:webpack -> webpackPlugin -> webpackOptions)
    at error (project_root/node_modules/di/lib/injector.js:22:12)
    at Object.parent.get (project_root/node_modules/di/lib/injector.js:9:13)
    at get (project_root/node_modules/di/lib/injector.js:54:19)
    at project_root/node_modules/di/lib/injector.js:71:14
    at Array.map (native)
    at invoke (project_root/node_modules/di/lib/injector.js:70:31)
    at Array.instantiate (project_root/node_modules/di/lib/injector.js:59:20)
    at get (project_root/node_modules/di/lib/injector.js:48:43)
    at project_root/node_modules/di/lib/injector.js:71:14
    at Array.map (native)
    at Array.invoke (project_root/node_modules/di/lib/injector.js:70:31)
    at get (project_root/node_modules/di/lib/injector.js:48:43)
    at instantiatePreprocessor (project_root/node_modules/karma/lib/preprocessor.js:52:20)
    at Array.forEach (native)
    at project_root/node_modules/karma/lib/preprocessor.js:68:21
    at Array.forEach (native)
    at createPreprocessor (project_root/node_modules/karma/lib/preprocessor.js:67:12)
    at Array.invoke (project_root/node_modules/di/lib/injector.js:75:15)
    at get (project_root/node_modules/di/lib/injector.js:48:43)
    at project_root/node_modules/di/lib/injector.js:71:14
    at Array.map (native)
    at invoke (project_root/node_modules/di/lib/injector.js:70:31)

I initially created this minimum-viable example for other issues, but the behavior above can now be seen in this latest project (simply install and test, as documented in the Read Me file). You'll note that the project uses goldhand/karma-webpack. The error was not seen previously, and we only started seeing this behavior today - I believe the change was when @goldhand's rebased his code two days ago for #128. I am able to replicate this behavior in this project, so the problem is not limited to goldhand/karma-webpack.

I have identified what is causing the issue for me, but cannot make sense of the change (made thanks to a diff). PR forthcoming.

@jambonrose
Copy link
Contributor Author

jambonrose commented Jul 26, 2016

As mentioned above, you can replicate the bug in the master branch of the minimum-viable example (MVE).

In the issue branch of the MVE you can see that the problem behavior has been removed. The issue branch uses jambonsw/karma-webpack#issue_146_fix_no_provider_errors.

@goldhand
Copy link
Collaborator

goldhand commented Jul 26, 2016

I just want to add, since I was called out in the the description, that I didn't change the code you revert in your fix.

👍 for cookiecutter-django btw, I like that project a lot

@jambonrose
Copy link
Contributor Author

@goldhand: I did not mean to implicate you! Simply trying to explain why the MVE uses your project, rather than this one, and that the problem occurs in both places. If anything, thanks for all your work! We've been using your branch for our projects.

I'm a big fan of cookiecutter and the ecosystem, too. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants