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

Silent error prevents site from building #5318

Closed
1 task done
nzakas opened this issue Nov 7, 2022 · 2 comments
Closed
1 task done

Silent error prevents site from building #5318

nzakas opened this issue Nov 7, 2022 · 2 comments

Comments

@nzakas
Copy link

nzakas commented Nov 7, 2022

What version of astro are you using?

1.6.2

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

None

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the Bug

I'm running Astro as a static site generator.

When I run npm run dev, I can navigate around my site just fine. All pages work and are generated correctly.

When I run npm run build, none of the pages are generated but no error messages are reported.

The problem seems to be with pages/feeds/blog.xml.js. If I rename this file to pages/feeds/_blog.xml.js, then npm run build builds all of the pages correctly. But because there's no error message, I can't tell what the problem is or how to fix it.

Link to Minimal Reproducible Example

https://github.com/humanwhocodes/money.humanwhocodes.com/tree/astro

Participation

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

bluwy commented Nov 8, 2022

This looks like a bug in Rollup. I've submitted an issue: rollup/rollup#4708

As a workaround, you can lazily initialize the posts variable in blog.xml.js instead of a top-level await.

let posts

export async function get() {
	if (!posts) {
		posts = await loadBlogPosts();
	}

Closing as it's an upstream issue.

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2022
@nzakas
Copy link
Author

nzakas commented Nov 8, 2022

Awesome, thank you.

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