Open ClintH opened 1 year ago
Honestly, not seeing that issue happen in the given repro. It seems to be working fine for me.
Thanks for taking a look! You don't see the error in the DevTools console? I see it using Edge & Chrome browsers.
Yeah, see it now. Had some wrong filters set in devtools console 🤦
Just ran into this, I'm using vite as well (with svelte kit).
This works fine in the demo due to path-browserify
, so fixed it by adding a similar polyfill for the path
module using an esbuild plugin from this gist.
Same problem for me :( Will be support for vite added??? Would be very much helpful...
@miraries can you please share what exactly and how did you use from that gist? I am looking into it but there are so much stuff that I cannot understand what I should take from it...
@valerii15298 Do npm i @esbuild-plugins/node-modules-polyfill
, then add the following resolve
config in your vite.config.js
:
export default defineConfig({
resolve: {
alias: {
path: 'rollup-plugin-node-polyfills/polyfills/path'
}
}
});
this just adds a polyfill for the path
module.
@miraries thank you very much!!!
@miraries btw, I made it work by installing only npm i rollup-plugin-node-polyfills
and it seems to work too without @esbuild-plugins/node-modules-polyfill
package
I'm also having the error as #9, 'path.dirname is not a function'. I have tried importing from 'monaco-editor-auto-typings/custom-editor' and passing in a monaco instance.
I am using Lit, TS & Vite and the latest version of monaco-editor-auto-typings.
Here's a minimal repro
I am not savvy when it comes to build processes, so maybe there is a Vite/Rollup setting I'm missing.
Any tips appreciated! :)