From 3f0dc1e772cdc6429a311bf28bb192ad7e4a5bcf Mon Sep 17 00:00:00 2001 From: Andree Klattenhoff Date: Wed, 11 Sep 2024 12:02:53 +0200 Subject: [PATCH] Fix: Resolve 3rd party esm without quibbledUrl --- .github/workflows/node.js.yml | 2 +- lib/quibble.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cf13308..571fd93 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [16.x, 18.x, 20.x] + node-version: [16.x, 18.x, 20.x, 22.x] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} diff --git a/lib/quibble.mjs b/lib/quibble.mjs index 125db13..fa94b69 100644 --- a/lib/quibble.mjs +++ b/lib/quibble.mjs @@ -59,7 +59,7 @@ export async function resolve (specifier, context, nextResolve) { const quibbledUrl = addQueryToUrl(url, '__quibble', stubModuleGeneration) - if (url.startsWith('node:') && !getStubsInfo(quibbledUrl)) { + if ((url.startsWith('node:') || url.includes('node_modules')) && !getStubsInfo(quibbledUrl)) { return { ...ctx, url } // It's allowed to change ctx for a builtin (but unlikely) }