You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at 20:24:19 ❯ node --import @sentry/node/preload ./dist/bin/server.js
node:internal/modules/run_main:125
triggerUncaughtException(
^
TypeError [Error]: parentResolve is not a function
at processModule (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:154:30)
at async processModule (/Users/x/Developer/contra/gaia/node_modules/.pnpm/[email protected]/node_modules/import-in-the-middle/hook.js:160:23)
This is the line where it happens:
// Bare specifiers need to be resolved relative to the parent module.
const result = await parentResolve(modFile, { parentURL: srcUrl })
If I inject console.log({parentResolve, modFile}); before, it prints:
async function processModule ({ srcUrl, context, parentGetSource, parentResolve, excludeDefault }) {
+ console.log({parentResolve});
const exportNames = await getExports(srcUrl, context, parentGetSource)
const duplicates = new Set()
const setters = new Map()
const addSetter = (name, setter) => {
// When doing an `import *` duplicates become undefined, so do the same
if (setters.has(name)) {
duplicates.add(name)
setters.delete(name)
} else if (!duplicates.has(name)) {
setters.set(name, setter)
}
}
for (const n of exportNames) {
if (n === 'default' && excludeDefault) continue
if (isStarExportLine(n) === true) {
const [, modFile] = n.split('* from ')
let modUrl
if (isBareSpecifier(modFile)) {
+ console.log({parentResolve, modFile});
// Bare specifiers need to be resolved relative to the parent module.
const result = await parentResolve(modFile, { parentURL: srcUrl })
Expected Behavior
import-in-the-middle
to work.Actual Behavior
This is the line where it happens:
If I inject
console.log({parentResolve, modFile});
before, it prints:Appears to be some sort of race condition.
Steps to Reproduce the Problem
N/A
Specifications
The text was updated successfully, but these errors were encountered: