Open gonstoll opened 2 months ago
I was able to resolve this as follows
In vite.config.ts
ssr: {
target: 'node',
noExternal: [
/react-tweet.*/,
...
]
}
And then I had to import the library components as
import * as ReactTweet from "react-tweet";
const {Tweet} = ReactTweet;
Not ideal and kind of hacky but I'm now able to use react-tweet in both dev and production in a Remix + Vite app.
Problem
When I try to make use of
enrichTweet
or any function exported from thereact-tweet
package, I get the following error:Reproduction
https://stackblitz.com/edit/remix-run-remix-8g6mfu?file=app%2Froutes%2F_index.tsx
Failed attempts
I have tried to edit my vite config in many ways, all of which were met with failure: