-
Notifications
You must be signed in to change notification settings - Fork 1.7k
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Monaco-graphql] Monaco-graphql fails to build with latest versions of Vite, monaco-editor and monaco-graphql. #3639
Comments
This is also failing in my project, which uses Webpack, not Vite. Looks like this is due to a recent change in I was able to work-around this by adding an alias to my webpack config: const config = {
// ...
resolve: {
alias: {
'monaco-editor/esm/vs/editor/contrib/hover/browser/hover': 'monaco-editor/esm/vs/editor/contrib/hover/browser/hoverController',
},
},
}; I suspect that the |
A PR would be welcome if you've tracked down a solution! |
Is there an existing issue for this?
Current Behavior
I get the following error when trying to run
npm run build
on the sample project provided below. It is a barebones skeleton React Vite starter app which imports monaco-editor and monaco-graphql in main.tsx and runs initializeMode. This was working in a previous version of monaco-editor 0.48.Error:
error during build:
[vite]: Rollup failed to resolve import "monaco-editor/esm/vs/editor/contrib/hover/browser/hover" from "/Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/monaco-graphql/esm/full.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
at viteWarn (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/vite/dist/node/chunks/dep-C1-ZB6nQ.js:65876:17)
at onwarn (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/@vitejs/plugin-react-swc/index.mjs:203:9)
at onRollupWarning (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/vite/dist/node/chunks/dep-C1-ZB6nQ.js:65909:5)
at onwarn (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/vite/dist/node/chunks/dep-C1-ZB6nQ.js:65571:7)
at file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/rollup/dist/es/shared/node-entry.js:18514:13
at Object.logger [as onLog] (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/rollup/dist/es/shared/node-entry.js:20162:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/rollup/dist/es/shared/node-entry.js:19104:26)
at file:///Users/skalidindi/oss/vite-monaco-editor-build-bug/node_modules/rollup/dist/es/shared/node-entry.js:19062:26
Repo: https://github.com/skalidindi/vite-monaco-editor-build-bug
Expected Behavior
I expect the occur to not occur and the build to pass.
Steps To Reproduce
Environment
react
Version: 18.3.1monaco-graphql
Version: 1.5.2monaco-editor
Version: 0.50.0Vite
Version: 5.3.1Anything else?
No response
The text was updated successfully, but these errors were encountered: