Can't use `optimizePackageImports` because it causes rendering errors
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- nextjs, typescript
Research direction
Reproduce the failure with optimizePackageImports in next.config.js, then inspect the enrichTweet import used by CustomTweet in src/components/ui/blog/mdx/tweet/custom-tweet.tsx. Trace how the react-tweet exports are handled by Next.js package optimization; done means the page renders successfully with this configuration and no longer reports that enrichTweet is not a function.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 119
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/react-tweet
-
`QuotedTweet.self_thread` is optional in syndication responsesPossibly taken @ocavue claimed this 21 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·
-
AbortError when playing video: "media was removed from the document"Possibly taken @ShobhanKarthish claimed this 36 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vercel/react-tweet#213 ·
-
why entities is not iterable also it shows Cannot read properties of undefined (reading 'indices')Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
vercel/react-tweet#221 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
vercel/react-tweet#212 · 8 comments · 29 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
vercel/react-tweet#208 ·
All issues in vercel/react-tweet