question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when calling createBuyOrder()

See original GitHub issue

I get the following error when i try to place a bid with createBuyOrder().

TypeError: process.versions is undefined
    XMLHttpRequest xml-http-request.js:92
    prepareRequest httpprovider.js:61
    sendAsync httpprovider.js:116
    sendAsync requestmanager.js:80
    send method.js:141
    call function.js:140
    promisifiedFunction promisify.js:58
    promisifiedFunction promisify.js:54
    step promisify.js:32
    verb promisify.js:13
    __awaiter promisify.js:7
    __awaiter promisify.js:3
    promisifiedFunction promisify.js:52
    callAsync wyvern_exchange.js:774
    step wyvern_exchange.js:42
    verb wyvern_exchange.js:23
    __awaiter wyvern_exchange.js:17
    __awaiter wyvern_exchange.js:13
    callAsync wyvern_exchange.js:768
    _buyOrderValidationAndApprovals seaport.js:2736
    step seaport.js:40
    verb seaport.js:21
    fulfilled seaport.js:12
    promise callback*step seaport.js:14
    fulfilled seaport.js:12
    promise callback*step seaport.js:14
    __awaiter seaport.js:15
    __awaiter seaport.js:11
    _buyOrderValidationAndApprovals seaport.js:2700
    createBuyOrder seaport.js:556
    step seaport.js:40
    verb seaport.js:21
    fulfilled seaport.js:12
    promise callback*step seaport.js:14
    __awaiter seaport.js:15
    __awaiter seaport.js:11
    createBuyOrder seaport.js:530

Here is the code that call the createBuyOrder method :

const result = await seaport.createBuyOrder({
  asset: {
    tokenId: this.asset.tokenId,
    tokenAddress: this.asset.tokenAddress,
    schemaName: this.asset.schemaName,
  },
  accountAddress,
  startAmount: this.bid.value,
  paymentTokenAddress,
});

I found the line in xhr2-cookies/dist/xml-http-request.js dependency : _this._userAgent = "Mozilla/5.0 (" + os.type() + " " + os.arch() + ") node.js/" + process.versions.node + " v8/" + process.versions.v8;

Declaring a global object doesn’t seem to work :

window.process = window.process || {}:
window.process.versions = window.process.versions || { node: '', v8: ''}:

Could you please tell me what I am doing wrong and/or how I can fix this issue ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
turinglabsorgcommented, Sep 15, 2021

Solved declaring versions like this:

process.versions = { node: "", v8: "" };
0reactions
esteban-OpenSeacommented, Apr 19, 2022

Checking in again, are you still running into this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

seaport.createBuyOrder is not working - returns 429 error every time ...
Hi Team. I'm using code from the opensea-creatures project (sell.js) to create an OpenSeaPort instance and call seaport.createBuyOrder().
Read more >
API Error 400: ['Expected exchange contract address to match']
Error while calling createBuyOrder(): API Error 400: ['Expected exchange contract address to match'] · I have enough wETH on my metamask account ...
Read more >
Unhandled Rejection Opensea error while making Buying Items
This example provider won't let you make transactions, only read-only calls: const provider = new Web3.providers.
Read more >
cloudflare access error WITHOUT requests - Moralis Forum
initPlugins() method and then call the Moralis.Plugins.opensea.createBuyOrder method. This is where the error starts, the method always ...
Read more >
OpenSeaSDK | opensea-js
Approve a fungible token (e.g. W-ETH) for use in trades. Called internally, but exposed for dev flexibility. Checks to see if the minimum...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found