error-overlay-webpack-plugin: We currently do not inject our entry code into single-file anonymous entries error

Hi,

Using "error-overlay-webpack-plugin": "^0.2.0" and "webpack": "^4.30.0", I got this error:

Error: We currently do not inject our entry code into single-file anonymous entries. Please use a multi-main (array) or object-form entry setting for now. at adjustEntry (PATH\node_modules\error-overlay-webpack-plugin\lib\index.js:56:11)

After removing error-overlay-webpack-plugin everything works fine.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (6 by maintainers)

Most upvoted comments

@neoziro if you can’t fix the issue (because of time limit or whatever), at least don’t close the issue with simple answer that don’t even fix the issue (I guess you are not sure neither as you mentioned I think in your answer). obviously I can not change my webpack config just because your plugin likes it that way.

Please don’t contribute to open source, but if you do be professional at it. I’ll remove your plugin, simply because I can not write my webpack config based on your buggy code.

I see you added help wanted tag to almost all issues. if you can not support (clearly you can’t), at least add a note in README, so users can make better decision about using your code.

Yeah you have to change entry I think, just that.

To anyone who like to have error overlay without error-overlay-webpack-plugin, the solution is very simple, just run npm i react-dev-utils -D and change the entry option of your webpack.config.js to: [require.resolve('react-dev-utils/webpackHotDevClient'), './index.jsx'], I’m using this method for months.

Remember, you should use react-dev-utils only in development mode.

@neoziro I cloned error-overlay-webpack-plugin, without any change the provided example works fine (of course I changed const ErrorOverlayPlugin = require('../lib') to const ErrorOverlayPlugin = require('../src')). also I updated wabpack packages and again everything works fine. I think I have to test the code with one of my projects. If I do (and could fix the problem), I’ll post the result here or submit PR for it.