petehunt / webpack-howto

10.12k stars 697 forks source link

Error in main.js when running: Module build failed: ReferenceError: [BABEL] #64

Open mcalthrop opened 8 years ago

mcalthrop commented 8 years ago

When I pull the latest code from the repo, install webpack globally, and run the example code, I get the following error message:

$ webpack

Hash: 396f0bfb9d565b6f60f0
Version: webpack 1.12.14
Time: 1401ms
    + 1 hidden modules

ERROR in ./modules/main.js
Module build failed: ReferenceError: [BABEL] /code/webpack-howto/example/modules/main.js: Unknown option: direct.presets
    at Logger.error (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/file/logger.js:58:11)
    at OptionManager.mergeOptions (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:29)
    at OptionManager.init (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/file/options/option-manager.js:216:10)
    at File.initOptions (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/file/index.js:147:75)
    at new File (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/file/index.js:137:22)
    at Pipeline.transform (/code/webpack-howto/example/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at transpile (/code/webpack-howto/example/node_modules/babel-loader/index.js:12:22)
    at Object.module.exports (/code/webpack-howto/example/node_modules/babel-loader/index.js:69:12)

Steps I took:

$ npm install -g webpack
$ cd example
$ npm install
$ webpack

Versions of node, npm and webpack installed:

$ node -v
v5.3.0
$ npm -v
3.3.12
$ webpack -v
Hash: 396f0bfb9d565b6f60f0
Version: webpack 1.12.14
Time: 22ms
# then same error message as above
mcalthrop commented 8 years ago

Found the solution; details in the PR (#65).

tomasky commented 8 years ago

The same error