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

Can't build astro if project path contains spaces on MacOS #12556

Open
1 task
hudmarc opened this issue Nov 28, 2024 · 4 comments · May be fixed by vitejs/vite#18837
Open
1 task

Can't build astro if project path contains spaces on MacOS #12556

hudmarc opened this issue Nov 28, 2024 · 4 comments · May be fixed by vitejs/vite#18837
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: upstream Upstream package has issue pkg: mdx Issues pertaining to `@astrojs/mdx` integration

Comments

@hudmarc
Copy link

hudmarc commented Nov 28, 2024

Astro Info

> astro info

Astro                    v5.0.0-beta.12
Node                     v18.20.4
System                   macOS (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap

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

No response

Describe the Bug

This might be an NPM or a Vite problem but I just started using Astro and it refuses to build if the project path contains a space on MacOS: for example, ".../new website" does not build, while ".../website" does.

The error is as follows:

astro vscode [ERROR] [vite] cannot find entry point module '.../Documents/new%20website/Site/node_modules/@astrojs/mdx/dist/server.js'.

It goes away if I change the path to the project to this: ".../Documents/Website/Site/node_modules/@astrojs/mdx/dist/server.js"

It was easy to fix for me, but I imagine if for example someone's username contains a space then they are in deep trouble.

What's the expected result?

Astro building my site.

Link to Minimal Reproducible Example

should be trivial to reproduce - in my case I just used the blog template and created a scratch project under a path with a space in the pathname.

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 Nov 28, 2024
@ascorbic
Copy link
Contributor

OK, I can reproduce this, and it's specifically an error in the MDX plugin. Thanks for the report!

@ascorbic ascorbic added pkg: mdx Issues pertaining to `@astrojs/mdx` integration - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs triage Issue needs to be triaged labels Nov 29, 2024
@ascorbic
Copy link
Contributor

Seems this was introduced in @astrojs/[email protected]

@ascorbic
Copy link
Contributor

Because of links etc, this can be reproduced in the Astro monorepo only if the monorepo itself has a space in the filename, or the package path.

@ascorbic
Copy link
Contributor

ascorbic commented Nov 29, 2024

Looks like this is a Vite bug: vitejs/vite#9917

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) ecosystem: upstream Upstream package has issue pkg: mdx Issues pertaining to `@astrojs/mdx` integration
Projects
None yet
2 participants