lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

🐛 BUG: Adding a backward slash silently causes Astro to hang without any feedback

Open ThatGuySam opened this issue 3 years ago • 2 comments

What version of astro are you using?

1.0.0-beta.47

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

Netlify

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

I just spent 6 hours trying to track down why I couldn't astro build or astro dev without indefinite hanging.

astro dev would just load indefinitely with no response and no feedback from command line.

Turns out I accidentally added a backward slash to the end of the layout property:

layout: ../../layouts/MainLayout.astro\

This stuck me so bad I hope publishing this at least helps someone else who's stuck

Here's demo using the Minimal Reproducible Example attached:

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2dabec?file=src%2Fpages%2Fen%2Fintroduction.md

Participation

  • [ ] I am willing to submit a pull request for this issue.

ThatGuySam avatar Jun 17 '22 20:06 ThatGuySam

Sorry you ran into this one @ThatGuySam, that definitely sounds frustrating! Looks like we have a good opportunity here for better DX validating the layout frontmatter and providing a useful error message 👍

Marking this as nice to have mainly because it's a DX improvement and not necessarily a bug fix, but DX is high on our list of goals before a 1.0 release so I'm hoping we'll be able to take care of this soon!

tony-sull avatar Jun 20 '22 15:06 tony-sull

@tony-sull Yeah at the very least this issue and my solution will show up when searching for astro silent hanging and they don't have to waste hours of their life on a single typo

ThatGuySam avatar Jun 20 '22 19:06 ThatGuySam