When I am running SvelteKit vite dev server with npm run dev I am getting error when trying to open a page:
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)
However Vite does not tell where the problem happens.
The same error message is with npm run build without more information.
How can I locate the problematic Svelte file having a parse error?
>Solution :
You should be able to attach a debugger at the location the error occurs.
How this is best done depends on IDE, for VS Code, e.g. see these docs.
When execution is halted you can navigate the stack and search for the location the source code is passed into the pipeline. If you have the relevant source, identifying the component should not be that hard.
If you want more specific advice, provide a minimal reproduction.
