After upgrading vitest
to latest version (1.1.2) from v0.33.0 for my React project, I'm seeing the following errors when running tests
Error: Expected ';', '}' or <eof>
❯ error node_modules/rollup/dist/es/shared/parseAst.js:337:30
❯ nodeConverters node_modules/rollup/dist/es/shared/parseAst.js:2084:9
❯ convertNode node_modules/rollup/dist/es/shared/parseAst.js:969:12
❯ convertProgram node_modules/rollup/dist/es/shared/parseAst.js:960:48
❯ parseAstAsync node_modules/rollup/dist/es/shared/parseAst.js:2150:20
❯ ssrTransformScript node_modules/vite/dist/node/chunks/dep-R0I0XnyH.js:49846:15
Any ideas what's going on here?
NOTE:
@vitejs/plugin-react
, @vitest/coverage-v8
, @vitest/ui
.I eventually sorted this out and the solution is very classic: I had to remove the yarn.lock file and rebuild it by running "yarn" command again. I know it's not an optimal solution, but it works for now...