当我运行 SvelteKit vite 开发服务器时,npm run dev
尝试打开页面时出现错误:
RollupError: Unexpected token `,`. Expected identifier or string
at getRollupError (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/parseAst.js:392:41)
at ParseError.initialise (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/node-entry.js:11170:28)
at convertNode (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/node-entry.js:12915:10)
at convertProgram (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/node-entry.js:12232:12)
at Module.setSource (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/node-entry.js:14076:24)
at async ModuleLoader.addModuleSource (file:///Users/moo/code/frentek/node_modules/rollup/dist/es/shared/node-entry.js:18729:13)
但Vite并没有透露问题出在哪里。
同样的错误消息没有npm run build
更多信息。
如何找到有解析错误的有问题的 Svelte 文件?