Skip to content

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

@hudmarc

Description

@hudmarc

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions