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
"Error: Got unexpected undefined" from parcel serve when errors present in Vue (SFC?) code #7395
Comments
Thank you for finding this! I've been going zombie-eyed while getting Got unexpected undefined at nullthrows all week. Your patch told me where the error was. OK, my error was also Anyway please put in a pull request! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
This is the problem with these "let's automatically close stale issues" bots. The patch still hasn't been applied to
I'm having to manually patch the JS in line with @mjog's issue description to get anything useful out of Parcel here. Why can't we keep this issue open until it gets fixed? |
🐛 bug report
When starting
parcel serve src/index.html
for a project I just upgraded from Parcel 1, I now get the following error whenever a build error is present:Adding some debug statements, I managed to work out that the underlying error is in some Vue code, and that the compiler doesn't seem to passing in a file path as part of the diagnostic object argument when calling
prettyDiagnostic()
- the second to last function in the stack above. As a result thefilePath
variable in that function is null in the stack above.I can work around this by changing
prettyDiagnostics()
's implementation from:to:
(Apologies for the crap patch, but I don't have the headspace to get a PR together for this at the moment.)
In doing so I get a slightly more helpful error message:
So while this bug is obstinately covering the issue that no decent error is reported when
filePath
is null, it would also be good to get the Vue compiler to report the path correctly as well. I suspect this is an issue with Vue SFC, since aside from the bootstrapping, all view code is in SVCs in this project - indeed that bogus use of<transition>
certainly is in a SFC.The text was updated successfully, but these errors were encountered: