Running into webpack issues for `generateComponents` _uploadthing_react__WEBPACK_IMPORTED_MODULE_0__

I am for some reason running into this webpack issue and i don't know why it was working yesterday.
src\common\lib\utils\uploadthing.ts (5:20) @ generateComponents
TypeError: (0 , _uploadthing_react__WEBPACK_IMPORTED_MODULE_0__.generateComponents) is not a function
at eval (webpack-internal:///(rsc)/./src/common/lib/utils/uploadthing.ts:9:122)
at (rsc)/./src/common/lib/utils/uploadthing.ts (.next\server\app\page.js:905:1)
at __webpack_require__ (.next\server\webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./src/common/lib/utils/index.ts:21:70)
at (rsc)/./src/common/lib/utils/index.ts (.next\server\app\page.js:861:1)
at __webpack_require__ (.next\server\webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./src/app/layout.tsx:13:68)
at (rsc)/./src/app/layout.tsx (.next\server\app\page.js:646:1)
at Function.__webpack_require__ (.next\server\webpack-runtime.js:33:43)
at async eq (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:401280)
at async tr (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:405046)
at async tn (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:405596)
at async tu (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:409938)
at async node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:410457 {
digest: '2950844787',
page: '/'
}
export const { UploadButton, UploadDropzone, Uploader } = generateComponents<OurFileRouter>();
src\common\lib\utils\uploadthing.ts (5:20) @ generateComponents
TypeError: (0 , _uploadthing_react__WEBPACK_IMPORTED_MODULE_0__.generateComponents) is not a function
at eval (webpack-internal:///(rsc)/./src/common/lib/utils/uploadthing.ts:9:122)
at (rsc)/./src/common/lib/utils/uploadthing.ts (.next\server\app\page.js:905:1)
at __webpack_require__ (.next\server\webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./src/common/lib/utils/index.ts:21:70)
at (rsc)/./src/common/lib/utils/index.ts (.next\server\app\page.js:861:1)
at __webpack_require__ (.next\server\webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./src/app/layout.tsx:13:68)
at (rsc)/./src/app/layout.tsx (.next\server\app\page.js:646:1)
at Function.__webpack_require__ (.next\server\webpack-runtime.js:33:43)
at async eq (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:401280)
at async tr (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:405046)
at async tn (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:405596)
at async tu (node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:409938)
at async node_modules\.pnpm\n[email protected][email protected][email protected]\node_modules\next\dist\compiled\next-server\app-page.runtime.dev.js:35:410457 {
digest: '2950844787',
page: '/'
}
export const { UploadButton, UploadDropzone, Uploader } = generateComponents<OurFileRouter>();
package versions: "next": "^14.0.3",, "uploadthing": "^6.0.1"
1 Reply
Glow
Glow12mo ago
I'm also running into this issue (v6.1.0 uploadthing, 14.0.4 nextjs). Did you ever find an answer for this? Found a fix - I was dumb and trying to use UploadButton from a server component. It must be called from a client component.
Want results from more Discord servers?
Add your server