-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
vitejs/vite
#18644Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Clear and concise description of the problem
When a js file has a syntax error, the logs only indicate that it failed to parse but not where.
FAIL test/suite.test.js [ test/suite.test.js ]
Error: Expression expected
❯ getRollupError node_modules/rollup/dist/es/shared/parseAst.js:558:41
❯ convertProgram node_modules/rollup/dist/es/shared/parseAst.js:1246:26
❯ Module.parseAstAsync node_modules/rollup/dist/es/shared/parseAst.js:2232:106
❯ ssrTransformScript node_modules/vite/dist/node/chunks/dep-BWSbWtLw.js:52430:11
Suggested solution
Show the same overview as for TS files, or at least the line/column number
FAIL test/basic.test.ts [ test/basic.test.ts ]
Error: Transform failed with 1 error:
/home/projects/vitest-dev-vitest-bdbgdx/test/basic.test.ts:29:1: ERROR: Unexpected end of file
Plugin: vite:esbuild
File: /home/projects/vitest-dev-vitest-bdbgdx/test/basic.test.ts:29:1
Unexpected end of file
27 | });
28 |
29 | -
| ^
❯ failureErrorWithLog node_modules/esbuild/lib/main.js:1462:15
❯ eval node_modules/esbuild/lib/main.js:745:50
❯ responseCallbacks.<computed> node_modules/esbuild/lib/main.js:612:9
❯ handleIncomingPacket node_modules/esbuild/lib/main.js:667:12
❯ Socket.readFromStdout node_modules/esbuild/lib/main.js:590:7
Alternative
No response
Additional context
Use-case: simple editors like nano without syntax validation, automatically-generated test files
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)