Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use optimizePackageImports because it causes rendering errors #166

Open
jahirfiquitiva opened this issue Apr 22, 2024 · 2 comments
Open

Comments

@jahirfiquitiva
Copy link
Contributor

If I add optimizePackageImports: ['react-tweet'], to my next.config.js it will cause the following error, breaking the page rendering

Error: (0 , _barrel_optimize_names_QuotedTweet_TweetActions_TweetBody_TweetContainer_TweetHeader_TweetInReplyTo_TweetInfo_TweetMedia_enrichTweet_react_tweet__WEBPACK_IMPORTED_MODULE_1__.enrichTweet) is not a function
at CustomTweet (webpack-internal:///(rsc)/./src/components/ui/blog/mdx/tweet/custom-tweet.tsx:11:208)
at eD (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:359300)
at e (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:365057)
at e8 (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:365554)
at e8 (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:365706)
at ta (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:371259)
at ti (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:371973)
at Timeout._onTimeout (/Users/jahir/dev/jahir/website/node_modules/next/dist/compiled/next-server/app-page-experimental.runtime.dev.js:35:360498)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
@lfades
Copy link
Member

lfades commented Apr 24, 2024

Why are you adding react-tweet to optimizePackageImports?

@jahirfiquitiva
Copy link
Contributor Author

@lfades I certainly am not sure 😅 ... I copied the config from another repo that used it which had it. Probably to reduce the client bundle, but I think it might not be needed anymore 🤔😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants