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

webpack-dev-server won't run #41

Closed
Blackbaud-DanHamlin opened this issue Jul 29, 2015 · 7 comments
Closed

webpack-dev-server won't run #41

Blackbaud-DanHamlin opened this issue Jul 29, 2015 · 7 comments

Comments

@Blackbaud-DanHamlin
Copy link

I'm getting the following when I run npm run server
I couldn't find any open issues with webpack or webpack-dev-server. Also, nothing is jumping out at me in the webpack config.

Dans-MBP:angular2-webpack-starter dan$ npm run server

> angular2-webpack-starter@0.0.0 server /Users/dan/Projects/js/angular2-webpack-starter
> webpack-dev-server --inline --colors --display-error-details --display-cached 

/Users/dan/Projects/js/angular2-webpack-starter/node_modules/webpack/node_modules/tapable/lib/Tapable.js:164
        arguments[i].apply(this);
                    ^
TypeError: Cannot read property 'apply' of undefined
    at Tapable.apply (/Users/dan/Projects/js/angular2-webpack-starter/node_modules/webpack/node_modules/tapable/lib/Tapable.js:164:15)
    at OptionsApply.WebpackOptionsApply.process (/Users/dan/Projects/js/angular2-webpack-starter/node_modules/webpack/lib/WebpackOptionsApply.js:62:18)
    at webpack (/Users/dan/Projects/js/angular2-webpack-starter/node_modules/webpack/lib/webpack.js:22:48)
    at Object.<anonymous> (/Users/dan/Projects/js/angular2-webpack-starter/node_modules/webpack-dev-server/bin/webpack-dev-server.js:133:12)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "server"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! angular2-webpack-starter@0.0.0 server: `webpack-dev-server --inline --colors --display-error-details --display-cached `
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular2-webpack-starter@0.0.0 server script 'webpack-dev-server --inline --colors --display-error-details --display-cached '.
npm ERR! This is most likely a problem with the angular2-webpack-starter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server --inline --colors --display-error-details --display-cached 
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular2-webpack-starter
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dan/Projects/js/angular2-webpack-starter/npm-debug.log
@PatrickJS
Copy link
Owner

@Blackbaud-DanHamlin could you delete node_modules/ and install it again. In the meantime you can use the express server with npm run express but make sure you install the deps first with npm run express-install

@Blackbaud-DanHamlin
Copy link
Author

Thanks, express did work. Removing node_modules and reinstalling didn’t fix my problem with webpack.

From: PatrickJS [mailto:notifications@github.com]
Sent: Wednesday, July 29, 2015 12:28 AM
To: angular-class/angular2-webpack-starter
Cc: Dan Hamlin
Subject: Re: [angular2-webpack-starter] webpack-dev-server won't run (#41)

@Blackbaud-DanHamlinhttps://github.com/Blackbaud-DanHamlin could you delete node_modules/ and install it again. In the meantime you can use the express server with npm run express but make sure you install the deps first with npm run express-install


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-125847683.

@noxxious
Copy link

I found the culprit - it seems that if NODE_ENV is not defined, then the environment plugins lookup produce a null to the plugins array in the webpack.config.js. Adding the definition to explicity default to development if NODE_ENV is not defined fixed it.

@PatrickJS
Copy link
Owner

@noxxious thanks for looking into it 👍 can you make a Pull-Request?

var NODE_ENV = process.env.NODE_ENV || 'development';

@Blackbaud-DanHamlin
Copy link
Author

great, i wonder if those npm scripts for setting the environment aren't actually working then?

@PatrickJS
Copy link
Owner

@noxxious you can make a pull-request simply just by clicking edit icon either on desktop or mobile
screen shot 2015-07-29 at 2 58 45 pm

@PatrickJS
Copy link
Owner

fixed via #43

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

3 participants