Error importing pure TS packages (with Bun, Turbo, or neither) #74252
Labels
bug
Issue was opened via the bug report template.
Module Resolution
Module resolution (CJS / ESM, module resolving).
Runtime
Related to Node.js or Edge Runtime with Next.js.
Turbopack
Related to Turbopack with Next.js.
TypeScript
Related to types with Next.js.
Webpack
Related to Webpack with Next.js.
Link to the code that reproduces this issue
https://github.com/ctjlewis/ts-package-example
To Reproduce
Repro here:
https://github.com/ctjlewis/nextjs-ts-package
It attempts to load this simple mock package:
https://github.com/ctjlewis/ts-package-example
Without Bun, Turbo throws:
When Bun is used with Turbo (
bun --bun next dev --turbo
), we get a segfault from Bun:Current vs. Expected behavior
It's important that the module resolve and load correctly. It is effectively the simplest possible pure-TS program.
Is it maybe the
module
export? I will try withexports
keyword after this, but either waymodule
entrypoint is simplest config.I doubt it is, since it seems to throw on the
type
keyword - is it actually expecting JS from allnode_modules
?Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 21.0.0 npm: 10.2.0 Yarn: 1.22.19 pnpm: 9.7.1 Relevant Packages: next: 15.1.1-canary.17 // Latest available version is detected (15.1.1-canary.17). eslint-config-next: 15.1.2 react: 19.0.0 react-dom: 19.0.0 typescript: 5.7.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Module Resolution, Runtime, Turbopack, TypeScript, Webpack
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
cc @/Jarred-Sumner for Bun crash, cc @/jaredpalmer for Turbopack, cc @/leerob for coordination.
(Config issue: Tags removed.)
The text was updated successfully, but these errors were encountered: