electron-react-boilerplate / electron-react-boilerplate

A Foundation for Scalable Cross-Platform Apps
https://electron-react-boilerplate.js.org/
MIT License
23.14k stars 3.85k forks source link

Doesn't work with opensea-js #3154

Closed fpena06 closed 2 years ago

fpena06 commented 2 years ago

Summary

I'm trying to use opensea-js with the boilerplate.

import { OpenSeaPort, Network } from 'opensea-js';

const seaport = new OpenSeaPort(provider, { networkName: Network.Main, apiKey: 'xxxxxxxxxxxxxxxx', });

But getting lots of errors and not sure how to figure it out, any help is appreciated.

Compiled with problems:X

WARNING in ./node_modules/@0x/assert/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/base-contract/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/utils/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/web3-wrapper/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/wyvern-js/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/wyvern-schemas/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/assert/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/base-contract/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/utils/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/@0x/web3-wrapper/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/wyvern-js/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

WARNING in ./node_modules/wyvern-schemas/node_modules/ethers/dist/ethers.min.js 1:484-485

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

amilajack commented 2 years ago

Install to release/app/package.json

fpena06 commented 2 years ago

yes, this is what I have done, also installed to package.json to see if that helped.

fpena06 commented 2 years ago

@amilajack could you please give it a try with a clean repo? It would save my sanity, I've been trying to get this to work for about a week now, thanks appreciate your help and support.

amilajack commented 2 years ago

Sure I'll give it a go

amilajack commented 2 years ago

Works for me.

Changeset: https://github.com/amilajack/erb-opensea-js-example/commit/0ae10f87af37267e7a2c2c2861fec36ff99c8779

git clone https://github.com/amilajack/erb-opensea-js-example
cd erb-opensea-js-example
npm i
npm start

Expected output in main process console:

OpenSeaPort {
  gasPriceAddition: 3,
  gasIncreaseFactor: 1.01,
  _getOrderCreateWyvernExchangeAddress: [Function (anonymous)],
  api: OpenSeaAPI {
    pageSize: 20,
    apiKey: 'xxxxxxxxxxxxxxxx',
    apiBaseUrl: 'https://api.opensea.io',
    hostUrl: 'https://opensea.io',
    logger: [Function (anonymous)]
  },

  ...
}