vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.72k stars 1.15k forks source link

[Rollup] Error Unknown Node Type: 677 #5030

Closed kbarnesMCC closed 8 months ago

kbarnesMCC commented 8 months ago

Describe the bug

I'm suddenly getting the following error when attempting to run my test suite that was working fine a few days ago:

Error: Unknown node type: 677 ❯ convertNode node_modules/rollup/dist/es/shared/parseAst.js:2055:15 ❯ convertNodeList node_modules/rollup/dist/es/shared/parseAst.js:2064:34 ❯ objectPattern node_modules/rollup/dist/es/shared/parseAst.js:1718:28 ❯ convertNode node_modules/rollup/dist/es/shared/parseAst.js:2057:12 ❯ convertProgram node_modules/rollup/dist/es/shared/parseAst.js:965:12 ❯ parseAstAsync node_modules/rollup/dist/es/shared/parseAst.js:2108:12 ❯ ssrTransformScript node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:50201:15 ❯ loadAndTransform node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:49789:11 ❯ ViteNodeServer._transformRequest node_modules/vite-node/dist/server.mjs:393:16 ❯ ViteNodeServer._fetchModule node_modules/vite-node/dist/server.mjs:359:17

While investigating a bit, I noticed Rollup had a new release in that timeframe (e.g. 4.9.6) and have confirmed by forcing Rollup to 4.9.5 things work correctly again. Not sure if this is a Vitest issue or a Rollup issue; but posting here as this is the original observation point.

For context, I'm using Vitest to provide unit testing for a Fastify API as a test running.

Reproduction

Upgrade to rollup@4.9.6 and observe working tests are now throwing the above error.

System Info

System:
    OS: Linux 5.15 Alpine Linux
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1265U
    Memory: 21.25 GB / 24.46 GB
    Container: Yes
    Shell: 1.35.0 - /bin/ash
  Binaries:
    Node: 18.16.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.1 - /usr/local/bin/npm
  npmPackages:
    @vitest/coverage-v8: 1.1.0 => 1.1.0 
    vitest: 1.1.0 => 1.1.0

Used Package Manager

npm

Validations

github-actions[bot] commented 8 months ago

Hello @kbarnesMCC. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

kbarnesMCC commented 8 months ago

Closing this issue; after further investigation it appears to be something related to our internal infrastructure and not Vitest specifically.