-
-
Notifications
You must be signed in to change notification settings - Fork 8k
vite:ssr-require-hook helper leaking into production with VitePress #6305
Copy link
Copy link
Closed
Labels
Description
Describe the bug
Related to vueuse/vueuse#1106
vite/packages/vite/src/node/plugins/ssrRequireHook.ts
Lines 26 to 30 in 7186857
| s.prepend( | |
| `;(${dedupeRequire.toString()})(${JSON.stringify( | |
| config.resolve.dedupe | |
| )});\n` | |
| ) |
Introduced in #3951
Workaround: add this inline plugin to remove 'vite:ssr-require-hook'
{
configResolved(config) {
const index = config.plugins.findIndex(i => i.name === 'vite:ssr-require-hook')
if (index > -1)
config.plugins.splice(index, 1)
},
}Reproduction
System Info
System:
OS: macOS 12.0.1
CPU: (10) arm64 Apple M1 Max
Memory: 12.74 GB / 64.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Browsers:
Chrome: 96.0.4664.110
Firefox: 92.0
Safari: 15.1
npmPackages:
vite: ^2.7.9 => 2.7.9Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable