Open benton-droplab opened 1 year ago
Same Error: Unsupported Server Component type: undefined
When trying to import a third-party component, using the new app dir.
See this thread: https://github.com/vercel/next.js/issues/41940 You could try creating a folder with an index.ts that exports all the third-party components you want to use and put "use client" at the top of the index.ts
A bit hacky but it might work.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/benton-droplab/export-reproduction
To Reproduce
Describe the Bug
Next throws the following error:
`Unhandled Runtime Error
Error: Unsupported Server Component type: undefined Call Stack attemptResolveElement node_modules/next/dist/compiled/react-server-dom-webpack/server.browser.js (1387:8) attemptResolveElement node_modules/next/dist/compiled/react-server-dom-webpack/server.browser.js (1850:20) resolveModelToJSON node_modules/next/dist/compiled/react-server-dom-webpack/server.browser.js (1210:13) stringify