Skip to content

Typescript error location is not displayed #587

@Mobyrr

Description

@Mobyrr

Describe the bug

When typescript parsing in template fail, the error location seems to be incorrectly displayed

[cause]: Transform failed with 1 error:
<stdin>:9:22: ERROR: Expected ")" but found ";"

the name of the file is <stdin> instead of the real name

Full error

> nuxt-module-build build

ℹ Building my-lib
ℹ Cleaning dist directory: ./dist

 ERROR  [vue-sfc-transform] Error parsing TypeScript expression in template

    at transformJsSnippets (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-sfc-transformer/dist/shared/vue-sfc-transformer.Cv4FCBX6.mjs:390:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async transpileVueTemplate (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-sfc-transformer/dist/shared/vue-sfc-transformer.Cv4FCBX6.mjs:309:24)
    at async templateLoader (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-sfc-transformer/dist/mkdist.mjs:146:23) 
    at async /C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-sfc-transformer/dist/mkdist.mjs:69:24
    at async Promise.all (index 1)
    at async /C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/vue-sfc-transformer/dist/mkdist.mjs:66:21
    at async loadFile (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]_pdpc6a7g2cab5ggmqvwowom4ly/node_modules/mkdist/dist/shared/mkdist.CcWb7-AJ.mjs:319:23)
    at async mkdist (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]_pdpc6a7g2cab5ggmqvwowom4ly/node_modules/mkdist/dist/shared/mkdist.CcWb7-AJ.mjs:678:21)
    at async mkdistBuild (/C:/projects/my-lib/module/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]_typescript@5._pkqujcdlb72xmdwfmgc7beimsy/node_modules/unbuild/dist/shared/unbuild.BQ_Ce1-K.mjs:1049:22)

  [cause]: Transform failed with 1 error:
<stdin>:9:22: ERROR: Expected ")" but found ";"

      at failureErrorWithLog (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1477:15)
      at node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:756:50
      at responseCallbacks.<computed> (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:623:9)
      at handleIncomingPacket (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:678:12)
      at Socket.readFromStdout (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:601:7)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
      at Socket.readFromStdout (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:601:7)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Socket.readFromStdout (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:601:7)
      at Socket.readFromStdout (node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:601:7)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)



 ERROR  [vue-sfc-transform] Error parsing TypeScript expression in template

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions