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

Astro 5 beta and Svelte npm install issue #12059

Closed
1 task
bigandy opened this issue Sep 23, 2024 · 3 comments · Fixed by #12060
Closed
1 task

Astro 5 beta and Svelte npm install issue #12059

bigandy opened this issue Sep 23, 2024 · 3 comments · Fixed by #12060
Labels
needs triage Issue needs to be triaged

Comments

@bigandy
Copy link

bigandy commented Sep 23, 2024

Astro Info

Astro                    v5.0.0-beta.1
Node                     v22.3.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I tried installing the svelte package using npx astro add svelte which resulted in a silent npm install error and a change to the astro.config.mjs file:

import svelte from '@astrojs/svelte';

// https://astro.build/config
export default defineConfig({
  integrations: [svelte()]
});

which causes a failure when running npm run dev due to absence of the @astrojs/svelte package (there is no package.json or package-lock.json changes).

I then tried a manual install of the required packages (running npm install @astrojs/svelte@^5.7.1 svelte@^4.2.19 typescript@^5.6.2) and this fails due to a peerdependencies issue in @astrojs/svelte:

npm install @astrojs/svelte@^5.7.1 svelte@^4.2.19 typescript@^5.6.2
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: astro-5-beta@0.0.1
npm error Found: astro@5.0.0-beta.1
npm error node_modules/astro
npm error astro@"^5.0.0-beta.1" from the root project
npm error
npm error Could not resolve dependency:
npm error peer astro@"^4.0.0" from @astrojs/svelte@5.7.1
npm error node_modules/@astrojs/svelte
npm error @astrojs/svelte@"^5.7.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error //.npm/_logs/2024-09-23T12_19_36_278Z-eresolve-report.txt
npm error A complete log of this run can be found in: //.npm/_logs/2024-09-23T12_19_36_278Z-debug-0.log

What's the expected result?

To be able to add svelte when using the Astro 5 beta.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-qkggru?file=package.json&view=editor

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 23, 2024
@florian-lefebvre florian-lefebvre linked a pull request Sep 24, 2024 that will close this issue
@florian-lefebvre
Copy link
Member

A beta of the svelte integration will soon be released, that will solve it. You can watch #12017

@bigandy
Copy link
Author

bigandy commented Sep 24, 2024

@florian-lefebvre

I repeated the steps with 5.0.0-beta.2 and still it tries to install the wrong version of @astrojs/svelte when running npx astro add svelte. The terminal text reads "npm install @astrojs/svelte@^5.7.1 svelte@^4.2.19 typescript@^5.6.2" instructions and also fails silently during the install process.

If I manually change the install to @astrojs/svelte@^6.0.0-beta.0 everything works successfully.

Will the npx astro add svelte script be updated, or is this still a bug?

@florian-lefebvre
Copy link
Member

astro add always uses the stable latest version by default so it's expected

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

Successfully merging a pull request may close this issue.

2 participants