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

Adding plugin to custom config throws compilation error #676

Closed
ericclemmons opened this issue Jan 24, 2017 · 1 comment
Closed

Adding plugin to custom config throws compilation error #676

ericclemmons opened this issue Jan 24, 2017 · 1 comment

Comments

@ericclemmons
Copy link
Contributor

Within .storybook/webpack.config.js:

  config.plugins.push(new webpack.EnvironmentPlugin([
    "API_URL",
    "NODE_ENV",
    "MIXPANEL_TOKEN",
  ]));
TypeError: callback is not a function at NullFactory.create
TypeError: callback is not a function at NullFactory.create (/Users/Eric/Projects/HigherEducation/platform/node_modules/webpack/lib/NullFactory.js:9:9) at /Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:214:11 at /Users/Eric/Projects/HigherEducation/platform/node_modules/async/lib/async.js:181:20 at Object.async.forEachOf.async.eachOf (/Users/Eric/Projects/HigherEducation/platform/node_modules/async/lib/async.js:233:13) at Object.async.forEach.async.each (/Users/Eric/Projects/HigherEducation/platform/node_modules/async/lib/async.js:209:22) at Compilation.addModuleDependencies (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:185:8) at Compilation.processModuleDependencies (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:170:7) at /Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:320:12 at /Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:123:4 at Array.forEach (native) at callback (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:122:12) at Compilation. (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/Compilation.js:140:10) at DependenciesBlock. (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/webpack/lib/NormalModule.js:115:10) at DependenciesBlock.onModuleBuild (/Users/Eric/Projects/HigherEducation/platform/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10) at nextLoader (/Users/Eric/Projects/HigherEducation/platform/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25) at /Users/Eric/Projects/HigherEducation/platform/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5 at Storage.finished (/Users/Eric/Projects/HigherEducation/platform/node_modules/@kadira/storybook/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16) at /Users/Eric/Projects/HigherEducation/platform/node_modules/graceful-fs/graceful-fs.js:78:16 at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:445:3)

I'm using:

"@kadira/storybook": "2.35.3",
"webpack": "2.1.0-beta.22",

It's been an hour and I can't figure out why webpack would mess up because I'm simply adding another plugin...

@ericclemmons
Copy link
Contributor Author

Ahah! I didn't realize that @kadira/storybook was using it's own webpack instead of the project one!.

#651 would be the correct solution.

In the meantime, anyone else with this problem can tell Storybook to use the webpack1 modules this way:

const webpack = require("@kadira/storybook/node_modules/webpack");

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

No branches or pull requests

1 participant