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

SVG logos break with 0.5.1 #339

Closed
1 task
seangwright opened this issue Jul 14, 2023 · 3 comments · Fixed by #343
Closed
1 task

SVG logos break with 0.5.1 #339

seangwright opened this issue Jul 14, 2023 · 3 comments · Fixed by #343
Labels
🐛 bug Something isn't working

Comments

@seangwright
Copy link

What version of starlight are you using?

0.5.1

What version of astro are you using?

2.8.3

What package manager are you using?

npm

What operating system are you using?

Mac

What browser are you using?

Brave, Safari

Describe the Bug

My site works fine on v0.4.2. When I update to 0.5.1, astro dev runs without errors, but when I load a page on my site, I receive the following error page:

Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.

virtual:starlight/user-images:1:188

Error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
at formatError (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:43902:46)
at TransformContext.error (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:43898:19)
at TransformContext.transform (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:41655:22)
at async Object.transform (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:44192:30)
at async loadAndTransform (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:54827:29)
at async instantiateModule (file:///Users/seanwright/dev/myproject/node_modules/vite/dist/node/chunks/dep-8609dc5d.js:55752:10)

In the terminal I see the following:

error Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
File:
virtual:starlight/user-images:1:188
Code:
1 | import dark from /src/assets/logo/dark-logo.svg; import light from /src/assets/logo/light-logo.svg; export const logos = { dark, light };
|

My logo svg files work just fine for light/dark mode in v0.4.2.

Link to Minimal Reproducible Example

No response

Participation

  • I am willing to submit a pull request for this issue.
@delucis delucis added the 🐛 bug Something isn't working label Jul 15, 2023
@delucis
Copy link
Member

delucis commented Jul 15, 2023

Oh yes, I can see immediately why this is happening. Sorry about that — will get a patch out fixing it today.

@delucis
Copy link
Member

delucis commented Jul 15, 2023

Should be fixed in 0.5.2!

@seangwright
Copy link
Author

Thanks! It's working great now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants