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

Update SvelteKit v1 devCommand #11494

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update SvelteKit v1 devCommand #11494

wants to merge 1 commit into from

Conversation

amyegan
Copy link
Contributor

@amyegan amyegan commented Apr 25, 2024

The current development command for the SvelteKit (v1) preset causes CORS errors in some cases. Overriding this command to exclude --port $PORT resolves the issue.

See https://github.com/orgs/vercel/discussions/3390 for background info

Copy link

changeset-bot bot commented Apr 25, 2024

⚠️ No Changeset found

Latest commit: 5d22d67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@trek
Copy link
Contributor

trek commented Apr 26, 2024

@amyegan do you know if this used to work in older Svelte versions? If so one risk of changing this is if someone deploys an older version of SvelteKit it would break for them.

@amyegan
Copy link
Contributor Author

amyegan commented Apr 26, 2024

@amyegan do you know if this used to work in older Svelte versions? If so one risk of changing this is if someone deploys an older version of SvelteKit it would break for them.

@trek Good question. I know that the current default dev command has been causing problems for the community since 26 July 2023 (around version 1.20.5), and possibly earlier than that.

I tried just now with version 1.0.0 which also seems to throw CORS errors on local with the default dev command and seems to work as desired with any of the overrides I have found to work with the latest version. My best guess is that it never worked as expected for v1 in certain situations.

For recent versions my workaround is to override the default dev command with vite, vite --port 3000, or vite --cors false. Certainly open to other solutions. Just went for the simplest one I've found 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants