Closed as not planned
Description
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
norvite 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.