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

Cannot find module @web-std, after latest version release of this dependency #1166

Closed
u-ajmal opened this issue Jan 25, 2022 · 6 comments
Closed
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@u-ajmal
Copy link

u-ajmal commented Jan 25, 2022

Use case

I am using nft.storage to upload nft to IPFS. There wasn't any issue earlier on, it just came up with the latest deployment we did. Each time a new deployment is done node modules are installed again.

Here is the package.json:

{
"name": "nft-management-backend",
"version": "0.1.0",
"description": "Backend APIs related to nft management",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/temp/nft-management-backend.git"
},
"dependencies": {
"@types/node": "^16.10.2",
"nft.storage": "^5.2.0",
},
}

Error returned

{
     "errorType": "Runtime.ImportModuleError",
     "errorMessage": "Error: Cannot find module '/var/task/node_modules/@web-std/fetch/dist/index.cjs'",
       "stack": [
           "Runtime.ImportModuleError: Error: Cannot find module '/var/task/node_modules/@web-std/fetch/dist/index.cjs'",
           "    at _loadUserApp (/var/runtime/UserFunction.js:202:13)",
           "    at Object.module.exports.load (/var/runtime/UserFunction.js:242:17)",
           "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
           "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
           "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
           "    at Module.load (internal/modules/cjs/loader.js:950:32)",
           "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
           "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)",
           "    at internal/main/run_main_module.js:17:47"
       ]
}
@u-ajmal u-ajmal added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 25, 2022
@u-ajmal u-ajmal changed the title Cannot find module @web-std Cannot find module @web-std, after latest version release of this dependency Jan 25, 2022
@dillondotzip
Copy link

I'm getting the same issue.

Do you know what version you were using before?

@u-ajmal
Copy link
Author

u-ajmal commented Jan 26, 2022

@iamserversurfer nft.storage version is the same but the dependent library @web-std got upgraded from 3.0.0 to 3.0.2. The upgrade needs to be handled appropriately. I had to downgrade nft.storage to version 4.0.1 for my functionality to work.

@alanshaw
Copy link
Contributor

@Gozala any chance you can look into this? Looks like the commonjs version didn't get published with the latest release.

@Gozala
Copy link
Contributor

Gozala commented Jan 28, 2022

Looks like this change web-std/io#35 introduced regression by leaving out that file from npm.

@Gozala
Copy link
Contributor

Gozala commented Jan 28, 2022

@u-ajmal should be fixed now, please reopen if you still encounter this.

@Gozala Gozala closed this as completed Jan 28, 2022
@anudit
Copy link

anudit commented Jan 31, 2022

@Gozala Still getting this in "nft.storage": "^5.2.2", downgrading to "nft.storage": "5.2.0" works tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

5 participants