-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
vite dev
doesn't copy assets to node_modules/.vite/deps
via new URL()
support in worker scripts
#10761
Comments
Possibly related to #8427 but the mentioned |
@schickling import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 8083,
},
build: {
sourcemap: true,
target: ['es2020'],
},
optimizeDeps: {
esbuildOptions: { target: 'es2020' },
exclude: ['sqlite-wasm-esm']
},
plugins: [
// Needed to enable OPFS
{
name: 'configure-response-headers',
configureServer: (server) => {
server.middlewares.use((_req, res, next) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin')
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp')
next()
})
},
},
],
}) |
Thanks a lot for your comment, I'll give the Given I have control over the |
I guess replacing |
Using Thanks for your help @sapphi-red |
Describe the bug
vite dev
doesn't copy assets tonode_modules/.vite/deps
vianew URL()
support in worker scriptsManually copying the missing assets to
node_modules/.vite/deps
seems to fix the problem as a workaround.Reproduction
https://github.com/schickling-test/2022-nov-vite-worker-dev-repro
Steps to reproduce
Unfortunately due to some Stackblitz WASM limitations, it doesn't work on Stackblitz yet.
Setup
Repro bug: dev not working
npm run dev # dev console should now show WASM errors and the network monitor should show 404s
Repro workaround: dev working
Repro prod build working
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: