Cannot read properties of undefined (reading 'Function')
Hey guys Have an issue with version 4.0.17 but looks like its coming after upgrading dependency web3 to 1.8.1
TypeError: Cannot read properties of undefined (reading 'Function')
at /Users/maksympalamarchuk/work/mbc/node_modules/opensea-js/lib/types.js:165:50
at Object.<anonymous> (/Users/maksympalamarchuk/work/mbc/node_modules/opensea-js/lib/types.js:167:3)
I'm using it client side with NextJS 12.3.4 Typescript 4.9.4
tsconfig
{
"compilerOptions": {
"target": "es5",
"lib": [
"es6",
"dom"
],
"baseUrl": ".",
"strict": true,
"noEmit": true,
"allowJs": true,
"jsx": "preserve",
"module": "esnext",
"incremental": true,
"skipLibCheck": true,
"noImplicitAny": true,
"noImplicitThis": true,
"esModuleInterop": true,
"isolatedModules": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"useUnknownInCatchVariables": false,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
},
"exclude": [
"node_modules"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
]
}
Please advise
Running into the same error. Happens both locally and on production CI.
"next": "^12.3.1",
"opensea-js": "^4.0.17",
"web3": "^1.8.0",
info Collecting page data .. TypeError: Cannot read properties of undefined (reading 'Function')
at /node_modules/opensea-js/lib/types.js:165:50
at Object.‹anonymous> (/node_modules/opensea-js/lib/types.js:167:3
at Module._compile (node: internal/modules/cjs/loader:1101:14)
at Object.Module. _extensions..js (node: internal/modules/cjs/loader:1153:10)
at Module.load (node: internal/modules/cjs/loader:981:32)
at Function.Module._load (node: internal/modules/cjs/loader:822:12)
at Module.require (node: internal/modules/cjs/loader:1005:19)
at require (node: internal/modules/cjs/helpers:102:18)
at Object.‹anonymous> (/node_modules/opensea-js/lib/constants.js:6:15)
at Module._compile (node: internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node: internal/modules/cjs/loader:1153:10)
at Module.load (node: internal/modules/cjs/loader:981:32)
at Function.Module._load (node: internal/modules/cjs/loader:822:12)
at Module.require (node: internal/modules/cjs/loader:1005:19)
at require(node: internal/modules/cjs/helpers:102:18)
at Object.<anonynous> (/node_nodules/opensea-js/lib/api.js: 83:19)
Previous version 4.0.16 doesn't seem to have the error but you'll run into the previous invalid protocol issue (#856) that 4.0.17 fixed so it's not a viable workaround unfortunately.
@reaganchisholm exactly where I am
4.0.18 was just released but issue still persists. I've reverted back to 4.0.13 for the time being but you will still get the unsupported protocol error. The official OpenSea API twitter recommends updating to 4.0.16 now, but it's currently not possible with NextJS it seems.
Hopefully someone from the OpenSea team can provide some direction or help to resolve the issue.
same issue
same issue
Are you seeing the issue on 4.0.18?
@montasaurus yes
Furthermore I'm having this issue server side as well when using node v16.19.0 + NestJS
Seems like the issue was fixed in 4.0.20
run fulfillOrder always throw unsupported protocol in 4.0.20.
runtime: nextjs(v13) server side
It does look like this specific issue is resolved in 4.0.20. But fairly certain an older version of code accidentally got published in 4.0.20 (#869) which I'm guessing means this issue won't be resolved once its synced back up with the current repo code.
Version 4.0.21 has been published. Please reach out if you are still experiencing this issue.
@JoshuaSchmidt-OpenSea cannot resolve module after upgrade to 4.0.21
Module not found: Can't resolve 'opensea-js'
@JoshuaSchmidt-OpenSea same issue with 4.0.23 Note the module structure after installation
node_modules/opensea-js/
├── LICENSE
├── README.md
├── lib
│ ├── package.json
│ └── src
├── node_modules
│ ├── ajv
│ ├── bignumber.js
│ └── json-schema-traverse
└── package.json
@MaximusDecimus The library structure has been fixed. https://www.npmjs.com/package/opensea-js/v/4.0.24?activeTab=explore