Describe the Bug
This issue is a follow up from #15609
After upgrading from 3.73.0 to 3.74.0 or higher, the command pnpm generate:importmap and pnpm migrate:create fails with an ESM export error.
The exported name mentioned exists, but for some reason it fails starting with version 3.74.0.
The same setup works correctly in 3.73.0.
Link to the code that reproduces this issue
https://github.com/italodr/payloadcms-turborepo-test
Reproduction Steps
Clone the repository
https://github.com/italodr/payloadcms-turborepo-test
I've created a simple project with Verdaccio and Docker for you to test. I've added a package to the storage directory, a simple function that logs "This is an example function" to the console, which you'll see if you run the development project.
You'll need to have two tabs open in your terminal. One for Verdaccio and another for the monorepo containing PayloadCMS
Terminal tab for Verdaccio
cd verdaccio
docker compose up
- You should be able to access http://0.0.0.0:4873/
Terminal tab for Monorepo (from the root)
pnpm i
pnpm build:packages (to simplify, the only existing package imports this private package and exports it)
cd examples/with-payload (we import and run the example function of the package in payload.config.ts)
pnpm dev (everything works correctly... you should be able to see the message mentioned above)
- Cmd/Ctrl + C
pnpm generate:importmap (error)
pnpm migrate:create (error)
Finally
You can change the Payload version to 3.73.0 in the root package.json file and in examples/with-payload, run the Monorepo process again. You'll see there's no error here. It only occurs from version 3.74.0 onwards.
Which area(s) are affected?
area: core
Environment Info
Binaries:
Node: 24.13.0
npm: 11.6.2
Yarn: 1.22.22
pnpm: 10.4.1
Relevant Packages:
payload: 3.77.0
next: 16.1.6
@payloadcms/db-sqlite: 3.77.0
@payloadcms/drizzle: 3.77.0
@payloadcms/graphql: 3.77.0
@payloadcms/next/utilities: 3.77.0
@payloadcms/richtext-lexical: 3.77.0
@payloadcms/translations: 3.77.0
@payloadcms/ui/shared: 3.77.0
react: 19.2.4
react-dom: 19.2.4
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Wed Oct 15 21:12:05 PDT 2025; root:xnu-11417.140.69.703.14~1/RELEASE_ARM64_T6030
Available memory (MB): 18432
Available CPU cores: 11
Describe the Bug
This issue is a follow up from #15609
After upgrading from
3.73.0to3.74.0or higher, the commandpnpm generate:importmapandpnpm migrate:createfails with an ESM export error.The exported name mentioned exists, but for some reason it fails starting with version
3.74.0.The same setup works correctly in
3.73.0.Link to the code that reproduces this issue
https://github.com/italodr/payloadcms-turborepo-test
Reproduction Steps
Clone the repository
https://github.com/italodr/payloadcms-turborepo-test
I've created a simple project with Verdaccio and Docker for you to test. I've added a package to the storage directory, a simple function that logs "This is an example function" to the console, which you'll see if you run the development project.
You'll need to have two tabs open in your terminal. One for Verdaccio and another for the monorepo containing PayloadCMS
Terminal tab for Verdaccio
cd verdacciodocker compose upTerminal tab for Monorepo (from the root)
pnpm ipnpm build:packages(to simplify, the only existing package imports this private package and exports it)cd examples/with-payload(we import and run the example function of the package in payload.config.ts)pnpm dev(everything works correctly... you should be able to see the message mentioned above)pnpm generate:importmap(error)pnpm migrate:create(error)Finally
You can change the Payload version to
3.73.0in the rootpackage.jsonfile and inexamples/with-payload, run the Monorepo process again. You'll see there's no error here. It only occurs from version3.74.0onwards.Which area(s) are affected?
area: core
Environment Info