Comments (7)
Confirmed the problem. It incorrectly refers to window.__webpack_public_path__
.
from monaco-editor-webpack-plugin.
@rgbkrk This was recently fixed here: #14. Newest release of this plugin v1.3.0 should have this.
from monaco-editor-webpack-plugin.
I'm currently running into an issue with this here: nteract/nteract#2992
$ npm ls monaco-editor-webpack-plugin
[email protected] /Users/kylek/code/src/github.com/nteract/nteract-ext
└── [email protected]
from monaco-editor-webpack-plugin.
We dynamically set the __webpack_public_path__
well before monaco is loaded (it loads in a chunk, dynamically imported, much later).
from monaco-editor-webpack-plugin.
🙏 Thank you!
from monaco-editor-webpack-plugin.
We dynamically set the
__webpack_public_path__
well before monaco is loaded (it loads in a chunk, dynamically imported, much later).
Could you provide an example of how you're going about setting the __webpack_public_path__
before monaco-editor-webpack-plugin initializes? I don't see how that is feasible as at least in my situation the webpack public path variable is set at runtime.
I end up with files in the correct location but instead of webpack looking for files in the correct public path, it looks for them a domain.com/js/worker.js when in reality it is domain.com/multi-site-name/default/some-version-hash/js/worker.js. We need this plugin to respect the runtime setting of __webpack_public_path__
from monaco-editor-webpack-plugin.
We wanted to provide an app which is loadable from any path, so therefore we dynamically determine the base path on runtime and use it as __webpack_public_path__
. The determination happens in the index.html
and afterwards based on the determined base path the bundle.js
is loaded.
So therefore we also had the problem loading the editor.worker.js
file.
We managed to overcome this problem by overriding the getWorkerUrl
in the MonacoEnvironment
object like this:
window.MonacoEnvironment = {
getWorkerUrl(moduleId, label) {
return `${BASE_PATH}${label == 'javascript' ? 'typescript' : 'editor'}.worker.js`;
}
};
If you want to provide more languages then you have to consider more workers (see issue).
As long as this issue and the subsequent PR is open, this can be considered as a temporary solution.
I hope this helps some people.
from monaco-editor-webpack-plugin.
Related Issues (20)
- How to chunk monaco-editor?
- Add support for webpack 5 HOT 4
- All languages are bundled HOT 3
- Safari errors HOT 2
- Error: Cannot find module 'vs/editor/contrib/anchorSelect/anchorSelect' HOT 3
- How to lazy load the chunk of monaco editor? HOT 3
- MonacoEnvironment.getWorker() doesn't fire for custom language HOT 4
- Example with "customLanguages" config section needed HOT 9
- Namespace 'webpack' has no exported member 'WebpackPluginInstance'. HOT 1
- trouble when trying to use monaco-editor on my own server HOT 6
- Cannot find module 'vs/editor/contrib/rename/onTypeRename' HOT 2
- Module not found : rename/onTypeRename HOT 1
- Use compiler.webpack instead of require('webpack') HOT 8
- [3.0.0] peerDependencies range specifies only 0.22.x; README says 0.23 is supported HOT 1
- Unable to use `global.MonacoEnvironment = { globalAPI: true }` to define a global monaco object
- Cannot read property 'split' of undefined HOT 1
- Outdated languages list HOT 2
- The monaco-editor version you rely on is not up to date HOT 1
- How does monaco-editor-webpack-plugin support go language?I need help!!! HOT 1
- What is the role of monaco-editor-webpack-plugin? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monaco-editor-webpack-plugin.