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

Migration should handle adapter-node changes. #279

Open
hyunbinseo opened this issue Dec 20, 2023 · 0 comments
Open

Migration should handle adapter-node changes. #279

hyunbinseo opened this issue Dec 20, 2023 · 0 comments
Labels
bug Something isn't working pkg:migrate svelte-migrate

Comments

@hyunbinseo
Copy link
Contributor

Describe the bug

Unlike other adapters in SvelteKit v2, adapter-node requires user review. change-log

breaking: remove polyfill option. fetch APIs will now always come from the platform being used. File and crypto APIs will be polyfilled if not available (sveltejs/kit#11172)

Currently,

  • Neither the migration log nor the documentation informs about this change.
  • Neither svelte-check nor vite build shows an error regarding the option.
  • Only when the svelte.config.js file is opened, the error can be seen.

Object literal may only specify known properties, and 'polyfill' does not exist in type 'AdapterOptions'.ts(2353)

Reproduction

pnpm dlx svelte-migrate@latest sveltekit-2

Logs

This will update files in the current directory
If you're inside a monorepo, run this in individual project directories rather than the workspace root.

✔ Continue? … yes
✔ Which folders should be migrated? › src
Updated @sveltejs/kit to ^2.0.0 
Updated @sveltejs/adapter-node to ^2.0.0 
Updated vite to ^5.0.0 
Updated vitest to ^1.0.0 
Added @sveltejs/vite-plugin-svelte version ^3.0.0  (vite-plugin-svelte is a peer dependency of SvelteKit now)
Changed `vitePreprocess` import: https://kit.svelte.dev/docs/migrating-to-sveltekit-2#vitepreprocess-is-no-longer-exported-from-sveltejs-kit-vite
Removed `throw` from redirect/error functions: https://kit.svelte.dev/docs/migrating-to-sveltekit-2#redirect-and-error-are-no-longer-thrown-by-you
Search codebase for `@migration` and manually add the `path` option to `cookies.set/delete/serialize` calls: https://kit.svelte.dev/docs/migrating-to-sveltekit-2#path-is-now-a-required-option-for-cookies
✔ Your project has been migrated

Recommended next steps:

  1: Run npm install (or the corresponding installation command of your package manager)
  2: git commit -m "migration to SvelteKit 2"
  3: Review the migration guide at https://kit.svelte.dev/docs/migrating-to-sveltekit-2
  4: Read the updated docs at https://kit.svelte.dev/docs

Run git diff to review changes.

System Info

System:
  OS: macOS 14.2.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 63.89 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.10.0 - ~/.volta/tools/image/node/20.10.0/bin/node
  npm: 10.2.3 - ~/.volta/tools/image/node/20.10.0/bin/npm
  pnpm: 8.12.1 - ~/.volta/bin/pnpm
Browsers:
  Chrome: 120.0.6099.109
  Edge: 120.0.2210.77
  Safari: 17.2.1
npmPackages:
  @sveltejs/adapter-node: ^2.0.0 => 2.0.1 
  @sveltejs/kit: ^2.0.0 => 2.0.4 
  @sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.1 
  svelte: ^4.2.8 => 4.2.8 
  vite: ^5.0.0 => 5.0.10

Severity

annoyance

Additional Information

Possible solutions are (from most viable)

  • Simply remove the polyfill key during migration, since it is no longer needed.
  • Add a /* @migration task: */ comment if the polyfill key exists.
  • Update the documentation to include Node.js adapter migrations.
@benmccann benmccann transferred this issue from sveltejs/kit Nov 7, 2024
@manuel3108 manuel3108 added bug Something isn't working pkg:migrate svelte-migrate labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:migrate svelte-migrate
Projects
None yet
Development

No branches or pull requests

2 participants