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

Runtime.UnhandledPromiseRejection -> Cannot find module 'asn1.js' #44174

Open
1 task done
kevlin200456 opened this issue Dec 20, 2022 · 1 comment
Open
1 task done
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@kevlin200456
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.8.0
npm: 6.14.17
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 12.2.5
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue

https://github.com/bigtimestudios/marketplace-frontend/blob/test-purchase/src/pages/sales/%5Bslug%5D/sale/%5BsaleId%5D/purchase/index.tsx

To Reproduce

we pushed the code to a branch and then vercel build the instance successfully. However, when you access the deployment through this url: https://bts-marketplace-iz9efs7m4-bigtime.vercel.app/sales/951b3e90-caad-4948-a5fb-66a94fac9a59/sale/a910273c-be88-4600-a591-a83c0a0156ef/purchase?q=1, it gives you the error of Runtime.UnhandledPromiseRejection MODULE NOT FOUND

Describe the Bug

when visit the route, the error 500 is returned and the route cannot be visited and the error I found on vercel logs:

"Unhandled Promise Rejection"{
   "errorType":"Runtime.UnhandledPromiseRejection",
   "errorMessage":"Error: Cannot find module 'asn1.js'\nRequire stack:\n- /var/task/node_modules/openpgp/dist/openpgp.js\n- /var/task/.next/server/pages/v1/sales/[slug]/sale/[saleId]/purchase.js\n- /var/task/node_modules/next/dist/server/require.js\n- /var/task/node_modules/next/dist/server/next-server.js\n- /var/task/___next_launcher.cjs",
   "reason":{
      "errorType":"Error",
      "errorMessage":" \nRequire stack:\n- /var/task/node_modules/openpgp/dist/openpgp.js\n- /var/task/.next/server/pages/v1/sales/[slug]/sale/[saleId]/purchase.js\n- /var/task/node_modules/next/dist/server/require.js\n- /var/task/node_modules/next/dist/server/next-server.js\n- /var/task/___next_launcher.cjs",
      "code":"MODULE_NOT_FOUND",
      "requireStack":[
         "/var/task/node_modules/openpgp/dist/openpgp.js",
         "/var/task/.next/server/pages/v1/sales/[slug]/sale/[saleId]/purchase.js",
         "/var/task/node_modules/next/dist/server/require.js",
         "/var/task/node_modules/next/dist/server/next-server.js",
         "/var/task/___next_launcher.cjs"
      ],
      "stack":[
         "Error: Cannot find module 'asn1.js'",
         "Require stack:",
         "- /var/task/node_modules/openpgp/dist/openpgp.js",
         "- /var/task/.next/server/pages/v1/sales/[slug]/sale/[saleId]/purchase.js",
         "- /var/task/node_modules/next/dist/server/require.js",
         "- /var/task/node_modules/next/dist/server/next-server.js",
         "- /var/task/___next_launcher.cjs",
         "    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)",
         "    at Module._load (node:internal/modules/cjs/loader:841:27)",
         "    at Module.require (node:internal/modules/cjs/loader:1061:19)",
         "    at require (node:internal/modules/cjs/helpers:103:18)",
         "    at o (/var/task/node_modules/openpgp/dist/openpgp.js:2:492)",
         "    at /var/task/node_modules/openpgp/dist/openpgp.js:2:683",
         "    at Object.<anonymous> (/var/task/node_modules/openpgp/dist/openpgp.js:30622:27)",
         "    at 108.../../config (/var/task/node_modules/openpgp/dist/openpgp.js:31139:4)",
         "    at o (/var/task/node_modules/openpgp/dist/openpgp.js:2:632)",
         "    at /var/task/node_modules/openpgp/dist/openpgp.js:2:683"
      ]
   },
   "promise":{
      
   },
   "stack":[
      "Runtime.UnhandledPromiseRejection: Error: Cannot find module 'asn1.js'",
      "Require stack:",
      "- /var/task/node_modules/openpgp/dist/openpgp.js",
      "- /var/task/.next/server/pages/v1/sales/[slug]/sale/[saleId]/purchase.js",
      "- /var/task/node_modules/next/dist/server/require.js",
      "- /var/task/node_modules/next/dist/server/next-server.js",
      "- /var/task/___next_launcher.cjs",
      "    at process.<anonymous> (file:///var/runtime/index.mjs:1194:17)",
      "    at process.emit (node:events:525:35)",
      "    at process.emit (node:domain:489:12)",
      "    at emit (node:internal/process/promises:149:20)",
      "    at processPromiseRejections (node:internal/process/promises:283:27)",
      "    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"
   ]
}"Unknown application error occurred
Runtime.Unknown"

you can find the logs here: build link

Expected Behavior

I should be able to visit the page like other pages in this application

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@kevlin200456 kevlin200456 added the bug Issue was opened via the bug report template. label Dec 20, 2022
@vercel-release-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@vercel-release-bot vercel-release-bot added the stale The issue has not seen recent activity. label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants