Poor error message in production build when client directive used on astro component #11623
Labels
- P2: nice to have
Not breaking anything but nice to have (priority)
feat: errors
Related to error handling / messages (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Directives like
client:idle
should only be used on framework components. When a client directive is used on an astro component, the commandnpm run dev
prints a helpful error message:However, the site renders normally in dev mode, and the developer can easily overlook this error message in the dev mode terminal.
In contrast, the command
npm run build
prints a confusing error message in this case:Developers will usually run only
astro build
in the CI pipeline.Enough people have stumbled over this for there to be a stackoverflow question for it: https://stackoverflow.com/questions/77508923/the-argument-path-must-be-a-string-uint8array-or-url-without-null-bytes-rec
What's the expected result?
The same helpful error message that is printed in dev mode should also be printed when running
npm run build
.Link to Minimal Reproducible Example
none
Participation
The text was updated successfully, but these errors were encountered: