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

TypeError: Cannot read property 'compilation' of undefined #254

Closed
tsneed290 opened this issue Jun 26, 2018 · 2 comments
Closed

TypeError: Cannot read property 'compilation' of undefined #254

tsneed290 opened this issue Jun 26, 2018 · 2 comments

Comments

@tsneed290
Copy link

tsneed290 commented Jun 26, 2018

Trying to run npm run storybook after cloning from Git and am getting the following error:

MacSneed:react-diagrams tsneed$ npm run storybook

> [email protected] storybook /Users/tsneed/dev/react-diagrams
> start-storybook -p 9001 -c .storybook

info @storybook/react v3.4.8
info
info => Loading custom addons config.
info => Loading custom webpack config (extending mode).
/Users/tsneed/dev/react-diagrams/node_modules/webpack/lib/DefinePlugin.js:51
		compiler.hooks.compilation.tap(
		               ^

TypeError: Cannot read property 'compilation' of undefined
    at DefinePlugin.apply (/Users/tsneed/dev/react-diagrams/node_modules/webpack/lib/DefinePlugin.js:51:18)
    at Compiler.apply (/Users/tsneed/dev/react-diagrams/node_modules/tapable/lib/Tapable.js:375:16)
    at webpack (/Users/tsneed/dev/react-diagrams/node_modules/@storybook/core/node_modules/webpack/lib/webpack.js:33:19)
    at exports.default (/Users/tsneed/dev/react-diagrams/node_modules/@storybook/core/dist/server/middleware.js:29:40)
    at buildDev (/Users/tsneed/dev/react-diagrams/node_modules/@storybook/core/dist/server/build-dev.js:163:36)
    at Object.<anonymous> (/Users/tsneed/dev/react-diagrams/node_modules/@storybook/react/dist/server/index.js:23:22)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/tsneed/dev/react-diagrams/node_modules/@storybook/react/bin/index.js:3:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] storybook: `start-storybook -p 9001 -c .storybook`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tsneed/.npm/_logs/2018-06-26T19_52_17_802Z-debug.log

I see an old issue #200, but removing lock files didn't help. I'm using NPM v5.5.1.

Thanks for any assistance!

@mitchhentges
Copy link

I've run into the same situation - this project uses a yarn lockfile, not an npm lockfile, so try using yarn instead:

(assuming linux/mac)

  1. rm -r node_modules
  2. yarn install
  3. yarn run storybook

@githubbob42
Copy link

I'm getting the same error and from what I've read (storybookjs/storybook#4392 (comment)), it looks like the current version is using webpack 4 plugin when storybook 3.x uses webpack 3.

I changed the versions of @storybook to use v4.1.12:

		"@storybook/addon-actions": "^4.1.12",
		"@storybook/addon-options": "^4.1.12",
		"@storybook/addon-storyshots": "^4.1.12",
		"@storybook/addons": "^4.1.12",
		"@storybook/react": "^4.1.12",

It now gets past the compilation but now it seems to hang after it says:
webpack built c4bc6671686041ecef2a in 16976ms.

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

4 participants