Wrangler is trying to bundle 'fs'. Why? even if I excluded it.

So i am using sveltekit template with to develop app for workers. One of my packages has required('fs') but it is false-positive. I tried to exclude it from vite build by using:
fs: fileURLToPath(new URL('./src/empty-module.js', import.meta.url)),
path: fileURLToPath(new URL('./src/empty-module.js', import.meta.url)),
os: fileURLToPath(new URL('./src/empty-module.js', import.meta.url))
fs: fileURLToPath(new URL('./src/empty-module.js', import.meta.url)),
path: fileURLToPath(new URL('./src/empty-module.js', import.meta.url)),
os: fileURLToPath(new URL('./src/empty-module.js', import.meta.url))
But it seems that it does not work. I search output folder but there is not reference to "fs" but when i run wrangler dev or deploy it throws me an error: 94 │ ...var fs=require("fs");require("path");D=__dirname+"/";Fa=a=>{a=G... Is there any possbility to fix this ? Thanks
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?