Skip to content

[Bug]: Could not resolve 'node:module' in rolldown:runtime (in GitHub Actions) #8097

@finalyards

Description

@finalyards

Reproduction link or steps

Running CI for my web site project (Vitest + Vite 8.0.0-beta10 + SvelteKit) fails in GitHub Actions.

Since the error message suggested to file an issue here, here comes. However, I'll just be copy-pasting the log (and attaching the GitHub Action definition) for now; need to finish the site. Can consider an MRE within a week or so, if Rolldown authors see it's required.

What is expected?

Running vitest should work in GitHub Actions.

What is actually happening?

Run npm run test:components
  
> [email protected] test:components
> vitest run --project=components
failed to load config from /__w/website.1/website.1/vitest.config.ts
⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯
Error: Build failed with 2 errors:
[RESOLVE_ERROR] Error: Could not resolve 'node:module' in rolldown:runtime
   ╭─[ rolldown:runtime:1:31 ]
   │
 1 │ import { createRequire } from 'node:module';
   │                               ──────┬──────  
   │                                     ╰──────── Tsconfig not found
───╯
[UNHANDLEABLE_ERROR] Error: Something went wrong inside rolldown, please report this problem at https://github.com/rolldown/rolldown/issues.
Tsconfig not found /__w/website.1/website.1/.tmpfs/.svelte-kit/tsconfig.json
Caused by:
    Failed to find tsconfig for file: /__w/website.1/website.1/vitest.config.ts
    at aggregateBindingErrorsIntoJsError (file:///__w/website.1/website.1/node_modules/rolldown/dist/shared/bindingify-input-options-Cb-01HR1.mjs:621:18)
    at unwrapBindingResult (file:///__w/website.1/website.1/node_modules/rolldown/dist/shared/bindingify-input-options-Cb-01HR1.mjs:591:128)
    at #build (file:///__w/website.1/website.1/node_modules/rolldown/dist/shared/rolldown-build-KB1YaNe-.mjs:2360:34)
    at async bundleConfigFile (file:///__w/website.1/website.1/node_modules/vite/dist/node/chunks/node.js:36036:17)
    at async bundleAndLoadConfigFile (file:///__w/website.1/website.1/node_modules/vite/dist/node/chunks/node.js:35945:18)
    at async loadConfigFromFile (file:///__w/website.1/website.1/node_modules/vite/dist/node/chunks/node.js:35914:42)
    at async resolveConfig (file:///__w/website.1/website.1/node_modules/vite/dist/node/chunks/node.js:35529:22)
    at async _createServer (file:///__w/website.1/website.1/node_modules/vite/dist/node/chunks/node.js:28104:65)
    at async createViteServer (file:///__w/website.1/website.1/node_modules/vitest/dist/chunks/cli-api.B7PN_QUv.js:9870:17)
    at async createVitest (file:///__w/website.1/website.1/node_modules/vitest/dist/chunks/cli-api.B7PN_QUv.js:13186:17) {
  errors: [Getter/Setter]
}
Error: Process completed with exit code 1.

System Info

From GitHub Actions:

System:
    OS: Linux 6.11 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    CPU: (2) x64 AMD EPYC 7763 64-Core Processor
    Memory: 6.71 GB / 7.76 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 24.13.0 - /__t/node/24.13.0/x64/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 11.6.2 - /__t/node/24.13.0/x64/bin/npm

Any additional comments?

.github/workflows/testing.yml:

name: testing

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  # normal throughput: xxx {3min14s}
  unit-tests:
    name: Run tests
    runs-on: ubuntu-latest
    container:
      # "Match the Playwright version in your container with your project dependencies" |1|
      image: mcr.microsoft.com/playwright:v1.57.0-noble
      options: --user 1001

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v6
        with:
          node-version: '24'

      - name: Install dependencies
        run: npm ci

      # By keeping the component, visible and site tests separate, we get clearer logs, and more valuable timing info
      # on how long it takes to execute each thing.
      - name: Component tests (SvelteKit)
        run: npm run test:components
      - name: Visible tests (single pages)
        run: npm run test:visible
      - name: Site tests (interactions)
        run: npm run test:site

vitest config for --project=components:

  test: {
    projects: [
      {
        extends: true,
        test: {
          name: 'components',
          include: ['src/**/{*.,}svelte.test.ts', 'tests/routes/**/{*.,}svelte.test.ts'],
          //reporters: ['default', 'html'],   // (not recognized by IDE, maybe in wrong place)
          browser: {
            enabled: true,
            headless: true, // for Multipass, CI
            provider: playwright({
              actionTimeout: 1000
            }),
            instances: [{ browser: 'chromium' }]
          }
        }
      },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions