-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Description
Expected Behavior
getExports
is throwing an error:
{
context: { format: 'module', importAttributes: {} },
error: Error: ENOENT: no such file or directory, open '/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-yoga/esm/@graphql-yoga/logger'
at async open (node:internal/fs/promises:633:25)
at async readFile (node:internal/fs/promises:1242:14)
at async getSource (node:internal/modules/esm/load:46:14)
at async defaultLoad (node:internal/modules/esm/load:137:34)
at async nextLoad (node:internal/modules/esm/hooks:750:22)
at async getExports (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/lib/get-exports.js:68:17)
at async processModule (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:134:23)
at async processModule (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:160:20)
at async getSource (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:269:60)
at async load (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:334:26) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-yoga/esm/@graphql-yoga/logger'
},
url: 'file:///Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected][email protected]/node_modules/graphql-yoga/esm/@graphql-yoga/logger'
}
I added the following code to catch the above error.
let parentCtx;
try {
parentCtx = await parentLoad(url, context)
} catch (error) {
console.log({
context,
error,
url
});
throw error;
}
The same code works if I remove --loader=import-in-the-middle/hook.mjs
.
Happy to provide more context.
Specifications
- Platform: Node.js v21
Metadata
Metadata
Assignees
Labels
No labels