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
{{ message }}
Repository navigation
@pascal-app/ifc-converter: published ESM uses extensionless relative imports, failing in Node with ERR_MODULE_NOT_FOUND #1285
@pascal-app/ifc-converter is published as ESM ("type": "module") and documents Node support in packages/ifc-converter/README.md ("No DOM, no React" and Node callers can pass { wasmPath: '/absolute/path/to/web-ifc/' } in ConversionOptions), but its emitted dist/*.js and dist/*.d.ts files keep extensionless relative specifiers (from './beam-geometry', from './export/guid', etc.).
Loading either @pascal-app/ifc-converter or @pascal-app/ifc-converter/export in Node fails immediately with ERR_MODULE_NOT_FOUND (and TypeScript projects using moduleResolution: "nodenext" without skipLibCheck fail with TS2835 on dist/*.d.ts). @pascal-app/core loads fine in the same install because core, geometry-script, nodes, and mcp run scripts/fix-node-esm-imports.ts after tsc --build, whereas packages/ifc-converter still runs plain tsc --build.
node:internal/modules/esm/resolve:241
throw new ERR_MODULE_NOT_FOUND(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/path/to/repro/node_modules/@pascal-app/ifc-converter/dist/beam-geometry' imported from /path/to/repro/node_modules/@pascal-app/ifc-converter/dist/index.js
at finalizeResolution (node:internal/modules/esm/resolve:241:11)
at moduleResolve (node:internal/modules/esm/resolve:846:10)
at defaultResolve (node:internal/modules/esm/resolve:973:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:708:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:728:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:766:56)
at #resolve (node:internal/modules/esm/loader:690:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:610:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:277:33)
at ModuleJob.link (node:internal/modules/esm/module_job:389:17) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///path/to/repro/node_modules/@pascal-app/ifc-converter/dist/beam-geometry'
}
Node.js v26.13.0
await import("@pascal-app/ifc-converter/export") fails the same way on /path/to/repro/node_modules/@pascal-app/ifc-converter/dist/export/guid imported from dist/export/index.js.
Expected behavior
Both @pascal-app/ifc-converter and @pascal-app/ifc-converter/export load cleanly under Node.js (for example by running bun ../../scripts/fix-node-esm-imports.ts dist in packages/ifc-converter's build script and adding a smoke:node check like @pascal-app/core).
Browser & OS
Node.js v26.13.0, Linux x64 (no browser involved)
Screenshots or screen recordings
N/A (Node CLI reproduction)
Additional context
Reproduced on @pascal-app/ifc-converter@1.1.4 (npm latest) and main (559c0d161). Related to #861, which wired scripts/fix-node-esm-imports.ts into core and mcp. Running bun ../../scripts/fix-node-esm-imports.ts dist on packages/ifc-converter makes both ./dist/index.js and ./dist/export/index.js import and run cleanly in Node v26.13.0.
Activity