You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MonacoWebpackPlugin causing 'TypeError: Cannot set property 'chunkLoading' of undefined' #2737
I'm creating an Electron app using react-monaco-editor, Forge and Webpack 5. Using MonacoWebpackPlugin in Webpack config causes Forge to throw the following error:
$ yarn start
yarn run v1.22.10
$ cross-env NODE_ENV=development electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
✖ Launch Dev Servers
An unhandled error has occurred inside Forge:
Cannot set property 'chunkLoading' of undefined
TypeError: Cannot set property 'chunkLoading' of undefined
at WebWorkerTemplatePlugin.apply (C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\webpack\lib\webworker\WebWorkerTemplatePlugin.js:20:40)
at Compiler.createChildCompiler (C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\@electron-forge\plugin-webpack\node_modules\webpack\lib\Compiler.js:561:12)
at Compilation.createChildCompiler (C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\@electron-forge\plugin-webpack\node_modules\webpack\lib\Compilation.js:2243:24)
at C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\monaco-editor-webpack-plugin\out\plugins\AddWorkerEntryPointPlugin.js:17:43
at AsyncParallelHook.eval [as callAsync] (eval at create (C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:25:1)
at AsyncParallelHook.lazyCompileHook (C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\tapable\lib\Hook.js:154:20)
at C:\Users\XXX\Desktop\8BitSimulatorV2\node_modules\@electron-forge\plugin-webpack\node_modules\webpack\lib\Compiler.js:669:20
SimulatorV2\node_modules\@electron-forge\plugin-webpack\node_modules\webpack\lib\Compiler.js:529:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
changed the title [-]MonacoWebpackPlugin causing errors[/-][+]MonacoWebpackPlugin causing 'TypeError: Cannot set property 'chunkLoading' of undefined'[/+]on Apr 11, 2021
Activity
[-]MonacoWebpackPlugin causing errors[/-][+]MonacoWebpackPlugin causing 'TypeError: Cannot set property 'chunkLoading' of undefined'[/+]iamaseem commentedon Apr 19, 2021
Facing same issue with nextjs
dgrechka commentedon Apr 23, 2021
The same for me. the same issue.
dgrechka commentedon Apr 23, 2021
Downgrading back to explicit version
"monaco-editor-webpack-plugin": "3.0.0"helped, the issue has gone.That can be a workaround for others.
mac501pl commentedon Apr 24, 2021
Downgrading didn't work for me
delagen commentedon May 13, 2021
May be also related to Webpack 5?
mac501pl commentedon May 13, 2021
This might very well be the case, apparently Forge doesn't support Webpack 5's definePlugin. Downgrading to Webpack 4 solves the issue.