loopbackio / loopbackio/loopback-next
latest @loopback/graphql ESM export compatibility error
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### Describe the bug
I downloaded the code from loopback GraphQL example repository https://github.com/loopbackio/loopback-next/tree/master/examples/graphql , and after fixing some type errors, when I start the application using Node v24.12.0, I encounter the following error:
``` shell
> @loopback/example-graphql@0.12.8 start
> node .
node:internal/modules/cjs/loader:686
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/interfaces' is not defined by "exports" in /Users/dinesh/Documents/Projects/example-graphql/node_modules/type-graphql/package.json
at exportsNotFound (node:internal/modules/esm/resolve:313:10)
at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
at resolveExports (node:internal/modules/cjs/loader:679:36)
at Module._findPath (node:internal/modules/cjs/loader:746:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1406:27)
at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
at Module._load (node:internal/modules/cjs/loader:1227:37)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
at Module.require (node:internal/modules/cjs/loader:1504:12)
at require (node:internal/modules/helpers:152:16)
at Object. (/Users/dinesh/Documents/Projects/example-graphql/node_modules/@loopback/graphql/dist/index.js:9:22)
at Module._compile (node:internal/modules/cjs/loader:1761:14)
at Object..js (node:internal/modules/cjs/loader:1893:10)
at Module.load (node:internal/modules/cjs/loader:1481:32) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v24.12.0
```
I think this behavior started with version 0.12.0
Expected Behavior:
The application should start without errors.
Actual Behavior:
The application fails to start with the error shown above.
Environment:
Node.js v24.12.0
npm 11.6.2
OS: MacOS 15.7.2 (M1 chip)
### Additional information
_No response_
### Reproduction
https://github.com/loopbackio/loopback-next/tree/master/examples/graphql
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the examples/graphql reproduction and inspect the @loopback/graphql/dist/index.js entry point shown in the stack trace, along with the type-graphql package exports. Run the example with Node.js 24 to confirm the failure and trace the incompatible subpath usage. Done means the application starts without ERR_PACKAGE_PATH_NOT_EXPORTED.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, node.js, typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100