felicio / status.app

https://status-app-nu.vercel.app
1 stars 0 forks source link

Resolve `Error: Cannot find module '../../package.json'` #3

Closed felicio closed 1 year ago

felicio commented 1 year ago
Error: Cannot find module '../../package.json'
Require stack:
- /vercel/path0/node_modules/@status-im/js/node_modules/@achingbrain/ssdp/dist/src/default-ssdp-options.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
    at mod._resolveFilename (/var/task/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at 92217 (/var/task/.next/server/chunks/197.js:113712:34)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at 45461 (/var/task/.next/server/pages/[entity]/[[...slug]].js:92:16)
    at __webpack_require__ (/var/task/.next/server/webpack-runtime.js:25:43)
    at __webpack_exec__ (/var/task/.next/server/pages/[entity]/[[...slug]].js:841:39) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/vercel/path0/node_modules/@status-im/js/node_modules/@achingbrain/ssdp/dist/src/default-ssdp-options.js'
  ],
  page: '/[entity]/[[...slug]]'
}
RequestId: db57a7d9-6b13-49f0-814b-d76a683ac249 Error: Runtime exited with error: exit status 1
Runtime.ExitError

// node_modules/@status-im/js/node_modules/@achingbrain/ssdp/package.json
// node_modules/@status-im/js/node_modules/@achingbrain/ssdp/src/default-ssdp-options.ts
// node_modules/@status-im/js/node_modules/@achingbrain/ssdp/dist/src/default-ssdp-options.js
felicio commented 1 year ago

Resolved with https://github.com/felicio/status-app/blob/c15dba0d47c05d094b8697ee7393cc717cd1eb4b/patches/%40achingbrain%2Bssdp%2B4.0.1.patch patch and manually editing its effective path.

felicio commented 1 year ago

Also opened PR upstream at https://github.com/achingbrain/ssdp/pull/40.

felicio commented 1 year ago

Resolved with https://github.com/felicio/status-app/blob/c15dba0d47c05d094b8697ee7393cc717cd1eb4b/patches/%40achingbrain%2Bssdp%2B4.0.1.patch patch and manually editing its effective path.

With the above patch, the error still wasn't completely resolved. Perhaps Vercel doesn't allow writing new files only editing. So replaced it for a new https://github.com/felicio/status-app/blob/f0747b00f797c7a87799119ebf2f498048047cdb/patches/%40achingbrain%2Bssdp%2B4.0.1.patch.