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

Apply @mjog's patch so that Vue SFC errors are actually displayed #8497

Merged
merged 1 commit into from Oct 14, 2022

Conversation

lol768
Copy link
Contributor

@lol768 lol768 commented Sep 23, 2022

See #7395

↪️ Pull Request

Applies the proposed patch from @mjog in #7395

🚨 Test instructions

  • Deliberately cause a Vue compile error in an SFC - e.g. <template v-for> key should be placed on the <template> tag.

  • Prior to applying the patch, you will get a useless Error: Got unexpected undefined message which doesn't tell you what the problem is:

Error: Got unexpected undefined
    at $812806c6461f2963$var$nullthrows (/home/adam/Documents/project/node_modules/@parcel/utils/lib/index.js:3485:17)
    at $f02d6a9d30f55938$export$2e2bcd8739ae039 (/home/adam/Documents/project/node_modules/@parcel/utils/lib/index.js:32342:195)
    at $7c213f7c22b64117$var$writeDiagnostic (/home/adam/Documents/project/node_modules/@parcel/reporter-cli/lib/CLIReporter.js:7435:167)
    at $7c213f7c22b64117$export$12358408d9820617 (/home/adam/Documents/project/node_modules/@parcel/reporter-cli/lib/CLIReporter.js:7401:19)
  • After the patch, observe that a better error is generated (note though that the name of the component is absent)
Build failed.

@parcel/transformer-vue: <template v-for> key should be placed on the <template> tag.

  SyntaxError: <template v-for> key should be placed on the <template> tag.
      at createCompilerError (/home/adam/Documents/project/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:18:19)
      at /home/adam/Documents/project/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js:3767:45
      at Array.some (<anonymous>)

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@mischnic
Copy link
Member

You also need to remove the line importing nullthrows, otherwise the linter will fail.

@mischnic
Copy link
Member

mischnic commented Sep 25, 2022

Please merge v2 into your branch or allow edits by maintainers, otherwise we can't merge this. (And this is the case for your other recent PRs as well)

@lol768
Copy link
Contributor Author

lol768 commented Sep 25, 2022

First, thanks for taking the time to review @mischnic

I'm not sure quite what's going on, but that checkbox doesn't appear for me:

image

I wonder if it's because I forked it to my client's org instead of my own personal account - it does say in the article "you can allow commits on branches you've created from forks owned by your personal account"

I've rebased this PR, I'll do the same with the others too now

@lol768
Copy link
Contributor Author

lol768 commented Sep 25, 2022

Others are rebased now, please shout if you need me to do it again at any point - it's not a problem 🙂

@mischnic
Copy link
Member

Others are rebased now, please shout if you need me to do it again at any point - it's not a problem 🙂

@lol768 😉

@lol768
Copy link
Contributor Author

lol768 commented Oct 14, 2022

Rebased :)

@mischnic mischnic merged commit 4ebb967 into parcel-bundler:v2 Oct 14, 2022
@lol768
Copy link
Contributor Author

lol768 commented Oct 14, 2022

Cheers

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

Successfully merging this pull request may close these issues.

None yet

2 participants