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

cannot update sveltekit to next.111 with latest adapters #1618

Closed
kamholz opened this issue Jun 1, 2021 · 11 comments · Fixed by #1620 or #1621
Closed

cannot update sveltekit to next.111 with latest adapters #1618

kamholz opened this issue Jun 1, 2021 · 11 comments · Fixed by #1620 or #1621
Labels
adapters - general Support for functionality general to all adapters bug Something isn't working

Comments

@kamholz
Copy link

kamholz commented Jun 1, 2021

Describe the bug
The peer dependencies on the latest adapter-node (next.23) appear to make it impossible to update kit past next.110. If I try to do so with npm install @sveltejs/kit@next, I get the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving:
npm ERR! Found: @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/kit
npm ERR!   dev @sveltejs/kit@"^1.0.0-next.111" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @sveltejs/kit@"1.0.0-next.110" from @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/adapter-node
npm ERR!   dev @sveltejs/adapter-node@"1.0.0-next.23" from the root project

Expected behavior
I don't expect adapter-node's peer deps to need to be updated every time kit is updated in order to use them together. This hasn't been the case over the past two months and if it's the new norm it will be pretty annoying, since kit is updated much more often than adapter-node. I hope this is just a hiccup following the new peer dependencies in adapter-node.

Severity
High severity given how much SvelteKit is in flux and the need to keep up with the latest version.

@kamholz kamholz changed the title cannot update sveltekit with latest adapter-node cannot update sveltekit to next.111 with latest adapter-node Jun 1, 2021
@JBusillo
Copy link
Contributor

JBusillo commented Jun 1, 2021

This also affects adapter-vercel (this was issue was raised on Discord).

@tonprince
Copy link

I had the same issue when using adapter-vercel, resulting in a 'resolve is undefined' error in the handle hook-function. I need to update to sveltekit next.111 but the peer dependency of adapter-vercel does not allow.

@tonprince
Copy link

tonprince commented Jun 1, 2021

Workaround for now:

  • Install a new sveltekit starter template
  • Manually replace kit-folder in node_modules of your project with the version (1.0.0-next.111) from the starter template

npm init svelte@next my-app
cd my-app
npm install

@frederikhors
Copy link
Contributor

This also affects adapter-static:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/kit
npm ERR!   dev @sveltejs/kit@"1.0.0-next.111" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @sveltejs/kit@"1.0.0-next.110" from @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/adapter-static
npm ERR!   dev @sveltejs/adapter-static@"1.0.0-next.12" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

@jthegedus
Copy link
Contributor

This will likely affect all adapters within the SvelteKit monorepo as they all have the same peer-dep requirement.

@ignatiusmb
Copy link
Member

ignatiusmb commented Jun 1, 2021

Kit monorepo uses pnpm which have no problem handling workspace dependencies. This is likely an issue with npm itself, which perhaps haven't support workspaces fully (yet) or even multiple version 1's, who knows.

Currently, npm update locks kit version to next.110 but upgrades everything else no problem. In the meantime, follow the npm error commands to either force install the latest next version, or manually change the version and force install again.

npm install @sveltejs/kit@next --force

# or, change the version in package.json and run the following
npm install --force

You can also use the --legacy-peer-deps flag, but this will significantly increase your lockfile lines

@kamholz
Copy link
Author

kamholz commented Jun 1, 2021

Kit monorepo uses pnpm which have no problem handling workspace dependencies. This is likely an issue with npm itself, which perhaps haven't support workspaces fully (yet) or even multiple version 1's, who knows.

I'm not so sure this is an issue with workspace dependency support in npm. If I look at adapter-node's package.json in node_modules/, I see this:

        "peerDependencies": {
                "@sveltejs/kit": "1.0.0-next.110"
        },

In other words, the package that was published to npm (the repository) has this version number hard-coded. That can't be fixed by using a different local client.

@ignatiusmb
Copy link
Member

You're right, I overlooked it. #1590 should've updated it too like what happens in #1543.

@kamholz
Copy link
Author

kamholz commented Jun 1, 2021

You're right, I overlooked it. #1590 should've updated it too like what happens in #1543.

Yeah, so this is related to my point that kit has typically been released quite a few times between adapter releases. Does this mean that now adapters are always supposed to be republished whenever kit is published, to keep the deps in sync? Or can peer deps be written more flexibly with semver?

@ClaytonFarr
Copy link

This will likely affect all adapters within the SvelteKit monorepo as they all have the same peer-dep requirement.

Yep. Looks like same issue is happening with Netlify adapter as well.

@benmccann benmccann added adapters - general Support for functionality general to all adapters bug Something isn't working labels Jun 1, 2021
@benmccann benmccann changed the title cannot update sveltekit to next.111 with latest adapter-node cannot update sveltekit to next.111 with latest adapters Jun 1, 2021
@benmccann benmccann reopened this Jun 1, 2021
@mylastore
Copy link

this worked for me

		adapter: {
			adapt: async () => await node()
		},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters - general Support for functionality general to all adapters bug Something isn't working
Projects
None yet
9 participants