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

"new URL(url, import.meta.url) is not supported in SSR" triggered even though the code never run on the server #8839

Closed
7 tasks done
MathiasWP opened this issue Jun 28, 2022 · 1 comment · Fixed by #8846
Closed
7 tasks done

Comments

@MathiasWP
Copy link

MathiasWP commented Jun 28, 2022

Describe the bug

Similar issue as #5169

The new URL(url, import.meta.url)\ is not supported in SSR.` error message is thrown even though the code is not fired on the server. I've created a minimal repro for the bug down below.

Initial svelte-kit issue

Reproduction

https://github.com/MathiasWP/vite-import-meta-url-srr-bug

System Info

System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Memory: 77.44 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.13.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 103.1.40.107
    Chrome: 103.0.5060.53
    Firefox: 100.0
    Safari: 14.1.1

Used Package Manager

npm

Logs

No response

Validations

@MathiasWP MathiasWP changed the title new URL(url, import.meta.url) wrongfully throws SSR error new URL(url, import.meta.url) is not supported in SSR triggered even though the code never run on the server Jun 28, 2022
@MathiasWP MathiasWP changed the title new URL(url, import.meta.url) is not supported in SSR triggered even though the code never run on the server "new URL(url, import.meta.url) is not supported in SSR" triggered even though the code never run on the server Jun 28, 2022
@MathiasWP
Copy link
Author

MathiasWP commented Jun 28, 2022

Note: I've updated the repro from being a svelte-kit project to being a standalone vite server.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 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