You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration to Svelte 4 using svelte-migrate fails if the project’s package.json doesn’t have dependencies. The error occurs here (the script attempts to read the package name on undefined):
Run npx svelte-migrate svelte-4 in a project that does not have dependencies in its package.json.
Logs
file:///Users/pm/.npm/_npx/ca732f115159e57c/node_modules/svelte-migrate/migrations/svelte-4/migrate.js:24
if (pkg.dependencies[name]) {
^
TypeError: Cannot read properties of undefined (reading 'svelte')
at update_pkg (file:///Users/pm/.npm/_npx/ca732f115159e57c/node_modules/svelte-migrate/migrations/svelte-4/migrate.js:24:23)
at update_pkg_json_content (file:///Users/pm/.npm/_npx/ca732f115159e57c/node_modules/svelte-migrate/migrations/svelte-4/migrate.js:34:2)
at update_pkg_json (file:///Users/pm/.npm/_npx/ca732f115159e57c/node_modules/svelte-migrate/migrations/svelte-4/migrate.js:7:3)
at migrate (file:///Users/pm/.npm/_npx/ca732f115159e57c/node_modules/svelte-migrate/migrations/svelte-4/index.js:59:2)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Describe the bug
Migration to Svelte 4 using
svelte-migrate
fails if the project’spackage.json
doesn’t havedependencies
. The error occurs here (the script attempts to read the package name onundefined
):kit/packages/migrate/migrations/svelte-4/migrate.js
Line 24 in c52bd3d
Reproduction
Run
npx svelte-migrate svelte-4
in a project that does not havedependencies
in itspackage.json
.Logs
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: