Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Using with CRA crashes the compilation because of Webpack thread-loader #16

Closed
fguitton opened this issue Jun 5, 2018 · 4 comments
Closed

Comments

@fguitton
Copy link

fguitton commented Jun 5, 2018

Hello everybody !

While using monaco-editor-webpack-plugin with create-react-app we can see the following error below.

This seems to be because of an incompatibility in the Webpack configuration with thread-loader

ERROR in ./node_modules/monaco-editor/esm/vs/editor/editor.main.js
Module build failed: Thread Loader (Worker 4)
Cannot read property 'userRequest' of undefined

    at Object.pitch (C:\Repos\project-ui\node_modules\monaco-editor-webpack-plugin\loaders\include.js:9:61)
 @ ./src/index.js 3:0-40
 @ multi ./node_modules/project-devutils/config/polyfills.js ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.js
@ninjatron
Copy link

Similar problem with create-react-app. I get this error when I try to instantiate monaco editor webpack plugin in plugin definitions of webpack config:

$ react-scripts start
Failed to compile.

Cannot read property 'normalModuleFactory' of undefined

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.

@Fer0x
Copy link

Fer0x commented Jul 2, 2018

Even with disabled thread-loader yarn build freezes and then crashes with lack of memory. The only working solution for me is to set up webpack config like this example: https://github.com/Microsoft/monaco-editor-samples/tree/master/browser-esm-webpack-small

@kandl
Copy link
Contributor

kandl commented Oct 1, 2018

For me, it's happening after upgrade react-create-app to v2.
I resolved it by removing those lines: 2698c97

@Fer0x
Copy link

Fer0x commented Oct 17, 2018

thread-loader has been removed in facebook/create-react-app#5170

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 2, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants