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

🐛 BUG: build copying public folder for build is not recursive #3016

Closed
1 task done
SteveALee opened this issue Apr 7, 2022 · 2 comments
Closed
1 task done

🐛 BUG: build copying public folder for build is not recursive #3016

SteveALee opened this issue Apr 7, 2022 · 2 comments

Comments

@SteveALee
Copy link
Contributor

SteveALee commented Apr 7, 2022

What version of astro are you using?

latest

What package manager are you using?

npm

What operating system are you using?

linux (wsl)

Describe the Bug

With https://stackblitz.com/edit/github-4qjebp?file=astro.config.mjs&on=stackblitz

dev server is fine but "build" fails when copying the public folder with:

"ENOENT: no such file or directory, copyFile '/home/projects/github-4qjebp/public/assets/logo.svg' -> '/home/projects/github-4qjebp/dist/client/assets/logo.svg'"

Reason is CopyFiles does not create the required subfolder (eg like "mkdir -p")

Sorry not minimal but this is where I hit the problem. I checked on local too. Build makes little in stackblitz but currently that's the only way to create a SSR endpoint. I hope this will change so can just "dev" without "build" step. Dito Netlify functions so can run locally

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-4qjebp?file=astro.config.mjs&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@SteveALee
Copy link
Contributor Author

SteveALee commented Apr 7, 2022

A quick fix would be to use the cp function with the recursive option but sadly it's experimental.

So probably use mkdir

@matthewp
Copy link
Contributor

matthewp commented Apr 7, 2022

If you are willing to submit a PR that is greatly appreciated!

SiriousHunter pushed a commit to SiriousHunter/astro that referenced this issue Feb 3, 2023
…stro#3037)

* Fix SSR static build public file copying

* chore: update lockfile

* remove dirname and use URL constructor

* Cleanup test and actually test what it says it tests

Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants