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

MacOs Sierra "npm run build.dev" failure caused by webpack #46

Closed
verdecchia opened this issue Feb 9, 2017 · 8 comments
Closed

MacOs Sierra "npm run build.dev" failure caused by webpack #46

verdecchia opened this issue Feb 9, 2017 · 8 comments

Comments

@verdecchia
Copy link

I run "npm install" and than "npm run build", but I receive error from webpack task.
Thank you,
I appreciate your help.

webpack --progress --profile
0% compiling/Users/mverdecchia/Documents/angular2/angular2-electron/node_modules/webpack-target-electron-renderer/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:37
if(externals === dependency.request) {
^

TypeError: Cannot read property 'request' of undefined
at handleExternals (/Users/mverdecchia/Documents/angular2/angular2-electron/node_modules/webpack-target-electron-renderer/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:37:33)
at next (/Users/mverdecchia/Documents/angular2/angular2-electron/node_modules/webpack-target-electron-renderer/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:46:8)
at handleExternals (/Users/mverdecchia/Documents/angular2/angular2-electron/node_modules/webpack-target-electron-renderer/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:59:7)
at ExternalModuleFactoryPlugin. (/Users/mverdecchia/Documents/angular2/angular2-electron/node_modules/webpack-target-electron-renderer/node_modules/webpack/lib/ExternalModuleFactoryPlugin.js:79:5)
at /usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:207:3
at NormalModuleFactory.applyPluginsAsyncWaterfall (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:196:70)
at NormalModuleFactory.create (/usr/local/lib/node_modules/webpack/lib/NormalModuleFactory.js:191:8)
at Compilation.process [as _addModuleChain] (/usr/local/lib/node_modules/webpack/lib/Compilation.js:359:16)
at Compilation.process [as addEntry] (/usr/local/lib/node_modules/webpack/lib/Compilation.js:435:7)
at SingleEntryPlugin. (/usr/local/lib/node_modules/webpack/lib/SingleEntryPlugin.js:22:15)
at Compiler.applyPluginsParallel (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:229:14)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/Compiler.js:463:8)
at Compiler.applyPluginsAsyncSeries (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:131:46)
at Compiler.compile (/usr/local/lib/node_modules/webpack/lib/Compiler.js:456:7)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/Compiler.js:219:10)
at Compiler.readRecords (/usr/local/lib/node_modules/webpack/lib/Compiler.js:367:10)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/Compiler.js:216:9)
at next (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:138:11)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/CachePlugin.js:34:58)
at Compiler.applyPluginsAsyncSeries (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:142:13)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/Compiler.js:213:8)
at next (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:138:11)
at Compiler. (/usr/local/lib/node_modules/webpack/lib/node/NodeEnvironmentPlugin.js:23:3)
at Compiler.applyPluginsAsyncSeries (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Tapable.js:142:13)
at Compiler.run (/usr/local/lib/node_modules/webpack/lib/Compiler.js:210:7)
at processOptions (/usr/local/lib/node_modules/webpack/bin/webpack.js:335:12)
at Object. (/usr/local/lib/node_modules/webpack/bin/webpack.js:339:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)

@verdecchia verdecchia changed the title MacOs Sierra "npm run build.dev" failure MacOs Sierra "npm run build.dev" failure caused by webpack Feb 9, 2017
@joaogarin
Copy link
Owner

Hello Can you check this issue, someone had something simillar but they where able to get it working? I cant seem to reproduce this one :/ #38

@joaogarin
Copy link
Owner

Hello,

Where you able to find something? There is also this issue here in the angular-cli which points to something simillar angular/angular-cli#1922

I just ran a clean

rm -rf node_modules && npm install && npm run build

And I got no errors.

Best regards
Joao Garin

@nagarsuresh
Copy link
Contributor

i was facing the same issue and I am very new to webpack+electon etc, i did one change and it got build and can see the app also require('os').platform() is printing darwin in console.
all i did was in the webpack.config.json
replace the line
config.target = webpackTargetElectronRenderer(config);
with
config.target = 'electron-renderer';
and commented webpackTargetElectronRenderer in the webpack.config.json
coz in the https://github.com/chentsulin/webpack-target-electron-renderer its given something like that.
is it ok to do that ?

@joaogarin
Copy link
Owner

Yes that looks correct looking at https://github.com/chentsulin/webpack-target-electron-renderer#migrate-to-webpack-2-or-webpack-1--11215

If you want to make a pull request for that it would be awesome. If not I will included as soon as I get some time.

Thanks for the info!

@nagarsuresh
Copy link
Contributor

Thanks @joaogarin ,
I will make a pull request for this.

@nagarsuresh
Copy link
Contributor

@joaogarin i am not able to create remote branch, could you add me as collaborator to the project.

@joaogarin
Copy link
Owner

You would have to fork the repository, create your own branch in your own repository (not in this one) and then issue a pull request.

You can read more about it here : https://help.github.com/articles/creating-a-pull-request/

@nagarsuresh
Copy link
Contributor

Thanks @joaogarin for pointing in right direction, created a pull request.

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