I wanted to integrate the thirdweb
library in a Meteor app today.
According to their Quickstart Docs, it uses the following import:
import { ThirdwebProvider, ConnectButton } from "thirdweb/react";
This works fine in their Next.js app, but not in my Meteor app. Meteor cannot resolve the thirdweb/react
path, although WebStorm can navigate to it without any issues. I only get the error from Meteor’s bundler (and also in the client).
The package.json
in the node_modules
folder has this export entry:
"exports": {
".": {
"types": "./dist/types/exports/thirdweb.d.ts",
"import": "./dist/esm/exports/thirdweb.js",
"default": "./dist/cjs/exports/thirdweb.js"
},
...
"./react": {
"types": "./dist/types/exports/react.d.ts",
"import": "./dist/esm/exports/react.js",
"react-native": "./dist/esm/exports/react.native.js",
"default": "./dist/cjs/exports/react.js"
},
...
"./package.json": "./package.json"
},
This looks fine to me.
What might be the issue why Meteor cannot find the component, though?
It’s the first time I am facing such a situation.
(I also noticed that I am getting a different error when pointing my import into the node_modules folder directly. In this case, I am getting the error that forwardRef
cannot be found. But this might be unrelated.)