diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2e83b77bd..efd2eee5d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,8 +15,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] + node: [18, 20, 22] - name: stable - ${{ matrix.os }} - node@20 + name: stable - ${{ matrix.os }} - node@${{ matrix.node }} runs-on: ${{ matrix.os }} steps: @@ -27,7 +28,7 @@ jobs: - name: Setup node uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} cache: 'pnpm' - name: 'Install dependencies' @@ -55,18 +56,13 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 - - - name: Cache NPM dependencies - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: npm-cache-ubuntu-latest-node@20 - - - uses: pnpm/action-setup@v4 + cache: 'pnpm' - name: 'Install dependencies' run: pnpm install diff --git a/packages/register/esm.mts b/packages/register/esm.mts index c913ac288..6f62babc0 100644 --- a/packages/register/esm.mts +++ b/packages/register/esm.mts @@ -279,6 +279,14 @@ export const load: LoadHook = async (url, context, nextLoad) => { const { source, format: resolvedFormat } = await nextLoad(url, context) + if (!source) { + debug('No source', url, resolvedFormat) + return { + source, + format: resolvedFormat, + } + } + debug('loaded', url, resolvedFormat) const code = !source || typeof source === 'string' ? source : Buffer.from(source).toString()