question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpack.base.babel.js bug when running npm run build

See original GitHub issue

Came across a very strange bug when running

npm run build

Basically, in the file ./internals/webpack/webpack.base.babel.js if you set the property stats to true you will see the following:

  devtool: options.devtool,
  target: 'web', // Make web variables accessible to webpack, e.g. window
  stats: true,  // Don't show stats in the console <--- this is the line 
  progress: true,

Results in

> reactjs-boilerplate@2.4.0 build /Users/xxxx/reactjs-boilerplate
> cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --colors -p

/Users/xxxx/reactjs-boilerplate/node_modules/webpack/bin/webpack.js:63
    var outputOptions = Object.create(options.stats || firstOptions.stats || {});
                               ^

TypeError: Object prototype may only be an Object or null: true
    at Function.create (native)
    at processOptions (/Users/xxxx/reactjs-boilerplate/node_modules/webpack/bin/webpack.js:63:29)
    at Object.<anonymous> (/Users/xxxx/reactjs-boilerplate/node_modules/webpack/bin/webpack.js:192:1)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:136:18)
    at node.js:972:3

I’m having trouble finding what this option does. Any clues?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
7rulnikcommented, Mar 27, 2016

Hi, @learntoswim Seems like options.stats must be an object. Try something like this:

stats: {
  // Config for minimal console.log mess.
  assets: false,
  colors: true,
  version: false,
  hash: false,
  timings: false,
  chunks: false,
  chunkModules: false
}

You can find more info here

0reactions
lock[bot]commented, May 30, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack is failing while trying to compile in production mode
This is my current webpack.base.babel.js file: ... The big deal comes out to stage if I say npm run-script build , if so...
Read more >
babel-loader - webpack
This package allows transpiling JavaScript files using Babel and webpack. ... NOTE: You must run npm install -D @babel/plugin-transform-runtime to include ...
Read more >
babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ......
Read more >
ts-loader - npm
Start using ts-loader in your project by running `npm i ts-loader`. ... Create or update webpack.config.js like so:.
Read more >
Create React App without Create React App - Bits and Pieces
How webpack and babel work in a more practical sense; ... now running npm run build will create main.js file again but the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found