withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
44.67k stars 2.33k forks source link

🐛 BUG: New astro project with svelte #2213

Closed suraj0901 closed 2 years ago

suraj0901 commented 2 years ago

What version of astro are you using?

0.21.12

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

Today i initialise new astro project with svelte and i encountered this image but it was working fine before

Link to Minimal Reproducible Example

https://bnmiqzypo--github--3000.local.webcontainer.io

austinjherman commented 2 years ago

Yes! I'm having this same problem. Sometime yesterday my whole dev environment stopped working and I'm seeing similar error messages. Also using svelte with astro, but on a mac.

Here's another minimal reproduction using the minimal starter and one svelte component. There's a different error message but maybe it's related?

https://github.com/austinjherman/astro-unable-to-render-svelte

Steps to reproduce:

  1. fork the repo and get it on your local machine
  2. run npm i
  3. run npm run build or npm run dev
boehs commented 2 years ago

Me too! What's the last working versions?

sarah11918 commented 2 years ago

Confirming that this is also happening with our Svelte starter example from astro.new in CodeSandbox.

See the Discord thread for the "temporary workaround" of setting Svelte components to "client:only" to at least get the dev environment to start: https://discord.com/channels/830184174198718474/921107451854614538

natemoo-re commented 2 years ago

Based on this timeline, I'm guessing that the new version of @sveltejs/vite-plugin-svelte that went out is why things are breaking? Does pinning @sveltejs/vite-plugin-svelte to 1.0.0-next.28 resolve the issue for anyone?

austinjherman commented 2 years ago

I tried pinning it as a dev dependency in package.json here. Still doesn't work in the sandbox though :/

Looking at the package-lock in that stackblitz, there are a couple different versions of @sveltejs/vite-plugin-svelte being used ranging from 1.0.0-next.28 to 1.0.0-next.32.

natemoo-re commented 2 years ago

That narrowed it down, thanks @austinjherman! PR here https://github.com/withastro/astro/pull/2216