Skip to content

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

Merged
mischnic merged 1 commit into
parcel-bundler:v2from
raileasyuk:fix/7395
Oct 14, 2022
Merged

Apply @mjog's patch so that Vue SFC errors are actually displayed#8497
mischnic merged 1 commit into
parcel-bundler:v2from
raileasyuk:fix/7395

Conversation

@lol768

@lol768 lol768 commented Sep 23, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread packages/core/utils/src/prettyDiagnostic.js Outdated
@mischnic

Copy link
Copy Markdown
Member

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

@mischnic

mischnic commented Sep 25, 2022

Copy link
Copy Markdown
Member

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

lol768 commented Sep 25, 2022

Copy link
Copy Markdown
Contributor Author

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

lol768 commented Sep 25, 2022

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

lol768 commented Oct 14, 2022

Copy link
Copy Markdown
Contributor Author

Rebased :)

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

lol768 commented Oct 14, 2022

Copy link
Copy Markdown
Contributor Author

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.

2 participants