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
However when i try to build my next.js app. I get this error:
`
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/@payloadcms/storage-uploadthing/dist/index.js from /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts not supported.
Instead change the require of index.js in /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts to a dynamic import() which is available in all CommonJS modules.
at Object.newLoader [as .js] (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:121:7)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts:21:27)
at Module._compile (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:117:24)
at Object.newLoader [as .ts] (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:121:7)
at loadConfig (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/config/load.js:28:27)
at build (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/bin/build.js:18:44)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/bin/index.js:62:21)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/bin.js:2:1) {
code: 'ERR_REQUIRE_ESM'
}
Describe the Bug
I have followed the steps to add uploadthings as my storage adapter here https://payloadcms.com/docs/upload/storage-adapters
However when i try to build my next.js app. I get this error:
`
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/@payloadcms/storage-uploadthing/dist/index.js from /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts not supported.
Instead change the require of index.js in /home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts to a dynamic import() which is available in all CommonJS modules.
at Object.newLoader [as .js] (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:121:7)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/src/payload/payload.config.ts:21:27)
at Module._compile (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:117:24)
at Object.newLoader [as .ts] (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/pirates/lib/index.js:121:7)
at loadConfig (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/config/load.js:28:27)
at build (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/bin/build.js:18:44)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/dist/bin/index.js:62:21)
at Object. (/home/mthizo/Documents/Workspaces/Frontend-workspace/menorah-store/node_modules/payload/bin.js:2:1) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v20.9.0
`
Link to the code that reproduces this issue
https://github.com/payloadcms/payload/tree/beta/packages/storage-uploadthing
Reproduction Steps
Follow docs to add uploadthings as storage adapter https://payloadcms.com/docs/upload/storage-adapters
Which area(s) are affected? (Select all that apply)
plugin: other
Environment Info
The text was updated successfully, but these errors were encountered: