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

Nft catalog not working in web enviroment #94

Open
PeterBenc opened this issue Oct 6, 2022 · 4 comments
Open

Nft catalog not working in web enviroment #94

PeterBenc opened this issue Oct 6, 2022 · 4 comments

Comments

@PeterBenc
Copy link

Issue:

  • when importing the npm package into a react app, the app does not load at all
  • the app crashes with Uncaught (in promise) ReferenceError: global is not defined

Possible cause:

Again, thanks for developing this package 👍 helps a lot :)

@prpatel05
Copy link
Contributor

What npm version of the package are you using?
Are you able to share the code that you are using to import and use the package?

@PeterBenc
Copy link
Author

The latest from the npm, I dont have my PC here, but I literaly started working with it today. 0.1.1 I think.

I can't really share the my code, but my guess is that it will be the same issue sinple create-react-app since the bundle.js uses global which is not accessible in the browser. At least according to that stack overflow issue.

@ccarnicle
Copy link

I am also running a react app and having the same "Global is not defined" issue.

@austinsamsel
Copy link
Collaborator

i think the problem is in the webpack config. nft-catalog is being bundled up for use in a node app: https://github.com/dapperlabs/nft-catalog/blob/main/webpack.config.js#L4

we can add a secondary config that bundles this up for client-side consumption

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

4 participants