Integration with Meteor JS fails
Opened this issue · 4 comments
Hi thirdweb, I am trying to integrate your platform into a Meteor JS application. Meteor uses a custom bundler, with which I haven't had issues with before when importing npm packages.
However, this is different with thirdweb
. In particular, imports like these
import { ThirdwebProvider } from 'thirdweb/react';
cannot be resolved. Although WebStorm can drill down into the package, Meteor won't be able to resolve this.
I then tried to import the ThirdwebProvider directly from the nodes_modules
folder:
import { ThirdwebProvider } from '../../../node_modules/thirdweb/dist/esm/exports/react.js';
This actually worked, but is not really "elegant".
What might be the reason for this? As I said, this is the first time I am facing such issue with an npm package. I also asked the Meteor community for help in parallel.
Side-note: As a third attempt, I tried your older 4.x React package, as described here:
https://www.npmjs.com/package/@thirdweb-dev/react
import { ThirdwebProvider } from '@thirdweb-dev/react';
However, this package tries to include thirdweb/pay
and thirdweb/utils
, which fail again because Meteor won't be able to resolve these names.
As an additional question: Is it really necessary to wrap the whole app in the ThirdwebProvider, or could I limit this wrapping to individual components as well? I'm a bit hesitatant with placing such a wrapper at such a central position, especially if bundling has some issues.
Hey @derwaldgeist, thanks for opening an issue! I'm personally not familiar with MeteorJS's bundler so I'm not immediately sure what could be the cause here. Is there any other info you could provide?
I'm guessing you're using Meteor with React here? If not, you don't need the ThirdwebProvider
but otherwise you will. It's fairly lightweight and is common for libraries like ours that have a global state for caching, wallet connections, etc.
This issue has been inactive for 30 days. It is now marked as stale and will be closed in 5 days if no further activity occurs.