Provide environment information
System:
OS: macOS 15.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 2.21 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.5.0 - /Users/hal8/.nvm/versions/node/v24.5.0/bin/node
npm: 11.6.0 - /Users/hal8/.nvm/versions/node/v24.5.0/bin/npm
bun: 1.2.18 - /Users/hal8/.bun/bin/bun
Browsers:
Chrome: 141.0.7390.108
Edge: 141.0.3537.92
Firefox: 144.0
Safari: 26.0.1
npmPackages:
@uploadthing/react: ^7.3.3 => 7.3.3
typescript: ^5.9.3 => 5.9.3
uploadthing: ^7.7.4 => 7.7.4
Describe the bug
When running Next.js 16 with Turbopack (the default in Next.js 16), UploadThing packages fail to compile with multiple module resolution and parsing errors. The application crashes on startup when trying to compile any page that imports UploadThing components.
Expected Behavior:
UploadThing should work seamlessly with Next.js 16's Turbopack bundler.
Actual Behavior:
The dev server fails to compile pages that use UploadThing, throwing multiple errors related to:
- Unknown module types for README.md and LICENSE files
- ECMAScript parsing errors in LICENSE files
- Module format mismatches (CommonJS vs ESM) in
.cts files
- Missing
.cjs file resolution
Link to reproduction
https://stackblitz.com/github/pingdotgg/uploadthing/tree/main/examples/minimal-appdir
To reproduce
- Create a Next.js 16 project (or upgrade existing project to Next.js 16)
- Install UploadThing:
npm install uploadthing @uploadthing/react
- Import and use any UploadThing component (e.g., in a page component)
- Run
npm run dev (Next.js 16 uses Turbopack by default)
- Navigate to a page that uses UploadThing
- Observe compilation errors
Additional information
Error Output
⨯ ./node_modules/@uploadthing/mime-types/README.md
Unknown module type
This module doesn't have an associated type. Use a known file extension, or register a loader for it.
⨯ ./node_modules/@uploadthing/react/README.md
Unknown module type
This module doesn't have an associated type. Use a known file extension, or register a loader for it.
⨯ ./node_modules/@uploadthing/mime-types/LICENSE:1:6
Parsing ecmascript source code failed
> 1 | (The MIT License)
| ^^^
Expected ',', got 'MIT'
⨯ ./node_modules/@uploadthing/react/LICENSE:1:5
Parsing ecmascript source code failed
> 1 | MIT License
| ^^^^^^^
Expected ';', '}' or <eof>
⨯ ./node_modules/@uploadthing/mime-types/application/index.d.cts
Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)
⨯ ./node_modules/@uploadthing/react/dist/index.d.cts
Specified module format (CommonJs) is not matching the module format of the source code (EcmaScript Modules)
⨯ ./node_modules/@uploadthing/react/native/index.d.cts:1:1
Module not found: Can't resolve '../dist/use-uploadthing-BnX8QvFV.cjs'
⨯ ./node_modules/@uploadthing/react/dist/index.d.cts:1:1
Module not found: Can't resolve './use-uploadthing-BnX8QvFV.cjs'
Suggested Fix
The UploadThing package may need to:
- Exclude non-code files (README.md, LICENSE) from being processed by bundlers
- Ensure CommonJS type definition files (
.d.cts) properly align with the actual module format
- Verify that all referenced
.cjs files exist in the distributed package
- Add explicit Turbopack compatibility testing to CI/CD pipeline
👨👧👦 Contributing
Code of Conduct
Provide environment information
System: OS: macOS 15.6.1 CPU: (10) arm64 Apple M1 Max Memory: 2.21 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 24.5.0 - /Users/hal8/.nvm/versions/node/v24.5.0/bin/node npm: 11.6.0 - /Users/hal8/.nvm/versions/node/v24.5.0/bin/npm bun: 1.2.18 - /Users/hal8/.bun/bin/bun Browsers: Chrome: 141.0.7390.108 Edge: 141.0.3537.92 Firefox: 144.0 Safari: 26.0.1 npmPackages: @uploadthing/react: ^7.3.3 => 7.3.3 typescript: ^5.9.3 => 5.9.3 uploadthing: ^7.7.4 => 7.7.4Describe the bug
When running Next.js 16 with Turbopack (the default in Next.js 16), UploadThing packages fail to compile with multiple module resolution and parsing errors. The application crashes on startup when trying to compile any page that imports UploadThing components.
Expected Behavior:
UploadThing should work seamlessly with Next.js 16's Turbopack bundler.
Actual Behavior:
The dev server fails to compile pages that use UploadThing, throwing multiple errors related to:
.ctsfiles.cjsfile resolutionLink to reproduction
https://stackblitz.com/github/pingdotgg/uploadthing/tree/main/examples/minimal-appdir
To reproduce
npm install uploadthing @uploadthing/reactnpm run dev(Next.js 16 uses Turbopack by default)Additional information
Error Output
Suggested Fix
The UploadThing package may need to:
.d.cts) properly align with the actual module format.cjsfiles exist in the distributed package👨👧👦 Contributing
Code of Conduct