Skip to content
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:ssr-require-hook helper leaking into production with VitePress #6305

Closed
7 tasks done
antfu opened this issue Dec 29, 2021 · 0 comments · Fixed by #6306
Closed
7 tasks done

vite:ssr-require-hook helper leaking into production with VitePress #6305

antfu opened this issue Dec 29, 2021 · 0 comments · Fixed by #6306

Comments

@antfu
Copy link
Member

antfu commented Dec 29, 2021

Describe the bug

Related to vueuse/vueuse#1106

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

https://stackblitz.com/edit/github-2f3nkj?file=index.md

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.9

Used Package Manager

pnpm

Logs

No response

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant