-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Uncaught ReferenceError: document is not defined #16277
Comments
Hello @JS-mark. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Also getting this error when running Vite in dev mode. |
I have this error using ffmpeg.wasm. I've back to 5.1.7 and works fine. This error occur exactly when try to create an instance of the ffmpeg. |
Yeah, I got back to normal when I was demoted to 5.1.7. |
Found the cause and created the minimal reproduction on StackBlitz: Important: When using Vite 5.2, the error starts happening when we add cross-origin isolation to the dev server: {
name: 'configure-response-headers',
configureServer: (server) => {
server.middlewares.use((_, res, next) => {
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
next();
});
},
}, Note how the app starts working again when the headers are removed: {
name: 'configure-response-headers',
configureServer: (server) => {
server.middlewares.use((_, res, next) => {
- res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');
- res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
next();
});
},
}, |
Related to #15852 (comment) |
Describe the bug
使用了 wasm
Reproduction
https://baidu.com
Steps to reproduce
pnpm dev
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: