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.glob crashes if filename contains apostrophe #4373

Closed
1 task
alvinometric opened this issue Aug 17, 2022 · 3 comments
Closed
1 task

Astro.glob crashes if filename contains apostrophe #4373

alvinometric opened this issue Aug 17, 2022 · 3 comments
Assignees
Labels
ecosystem: upstream Upstream package has issue

Comments

@alvinometric
Copy link
Contributor

What version of astro are you using?

1.0.6

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

If the filename of one of the files read by Astro.glob contains an apostrophe ', everything crashes.

---
const posts = await Astro.glob('../content/**/*.md')
console.log(posts);
---

<main>

</main>

You can see the error in the reproducible example.

The biggest issue is, it just crashes. There wasn't any clear error message telling me it was a filename issue. It took trial and error to figure out.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-mjfepe-lwngmi?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Aug 18, 2022

This is a bug upstream in Vite. I submitted vitejs/vite#9729 which should fix this. Will close the PR when we update the Vite version used.

@bluwy bluwy added the ecosystem: upstream Upstream package has issue label Aug 18, 2022
@alvinometric
Copy link
Contributor Author

Fantastic, thank you for the quick turnaround

@FredKSchott
Copy link
Member

Fixed upstream!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosystem: upstream Upstream package has issue
Projects
None yet
Development

No branches or pull requests

3 participants