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

Run-time error in @vue/compiler-core - all versions after 3.4.25 #11221

Closed
tmcdos opened this issue Jun 25, 2024 · 2 comments
Closed

Run-time error in @vue/compiler-core - all versions after 3.4.25 #11221

tmcdos opened this issue Jun 25, 2024 · 2 comments

Comments

@tmcdos
Copy link

tmcdos commented Jun 25, 2024

Vue version

3.4.30

Link to minimal reproduction

https://stackblitz.com/edit/tmcdos-compiler-core?file=package.json

Steps to reproduce

  1. Execute npm i
  2. Execute npm run serve or npm run build

What is expected?

Application should start without run-time errors in any of the packages inside node_modules

What is actually happening?

There is a run-time error in @vue/compiler-core - all versions after 3.4.25 (3.4.26/27/28/29/30)
The error occurs on line 314 in file packages/compiler-core/src/transforms/transformExpression.ts
https://github.com/vuejs/core/blob/v3.4.26/packages/compiler-core/src/transforms/transformExpression.ts#L314
because parent is undefined.

 App •  ERROR  •  UI  in ./src/views/FrontVariable.vue?vue&type=template&id=13f3b97b

Syntax Error: processExpression/<@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:4350:13
enter@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1518:23
visit@/home/projects/tmcdos-compiler-core/node_modules/estree-walker/dist/umd/estree-walker.js:116:17
walk@/home/projects/tmcdos-compiler-core/node_modules/estree-walker/dist/umd/estree-walker.js:322:19
walkIdentifiers@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1508:16
processExpression@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:4333:18
transformExpression@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:4208:21
traverseNode@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3355:38
traverseChildren@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3347:17
traverseNode@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3389:23
processIf@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:4519:21
transformIf<@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:4424:12
createStructuralDirectiveTransform/<@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3412:28
traverseNode@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3355:38
traverseChildren@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3347:17
traverseNode@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3389:23
transform@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:3281:15
baseCompile@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:6447:12
compile@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js:685:23
doCompileTemplate@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:4286:47
compileTemplate@/home/projects/tmcdos-compiler-core/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:4228:12
TemplateLoader@/home/projects/tmcdos-compiler-core/node_modules/vue-loader/dist/templateLoader.js:53:37

shot-1

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    vue: ^3.4.30 => 3.4.30

Any additional comments?

The error does not occur on old versions of @vue/compiler-core - e.g. 3.4.25 and below.
It occurs on recent versions - 3.4.26 and above, up to the latest.
My current workaround is to patch the package and add a check for non-NULL parent on the above line
https://github.com/vuejs/core/blob/v3.4.26/packages/compiler-core/src/transforms/transformExpression.ts#L314

@jh-leong
Copy link
Member

duplicate of #11216

@tmcdos
Copy link
Author

tmcdos commented Jun 25, 2024

@jh-leong Sorry, did not notice it is the same error. You can safely close this ticket since you already made a fix.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants