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

Catch things like bad path references at dev-time-checks in codebase #440

Closed
vindard opened this issue Aug 10, 2021 · 3 comments
Closed

Comments

@vindard
Copy link
Contributor

vindard commented Aug 10, 2021

An example of this error is captured in PR #437

Description from Slack

"A bug has been pushed to testnet, that's why testnet deploy is failing. All our graphql related pods are failing.
This is the error -"

Error: Cannot find module '@domain//errors'
Require stack:
- /app/lib/services/mongoose/invoices.js
- /app/lib/core/lightning/index.js
- /app/lib/core/lightning/wallet.js
- /app/lib/core/wallet-factory.js
- /app/lib/servers/exporter.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/app/lib/services/mongoose/invoices.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/app/lib/core/lightning/index.js:13:20)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/app/lib/services/mongoose/invoices.js',
'/app/lib/core/lightning/index.js',
'/app/lib/core/lightning/wallet.js',
'/app/lib/core/wallet-factory.js',
'/app/lib/servers/exporter.js'
]
}

@vindard
Copy link
Contributor Author

vindard commented Aug 10, 2021

For this issue specifically, I found this related issue that says that the "import/no-useless-path-segments" rule can fix this. When I tried it though:

  • it worked for absolute imports (e.g. ".//schema" got linted)
  • it didn't work for mapped imports though because the double // seems to resolve correctly in the checks but doesn't compile correctly when we build?

(cc @samerbuna @dolcalmi)

Screenshot from 2021-08-10 10-16-05

@nicolasburtey
Copy link
Member

has this been fixed?

@vindard
Copy link
Contributor Author

vindard commented Jan 14, 2022

has this been fixed?

Just tested, it seems like our codebase can now correctly resolve things like

import { WalletsRepository } from "@services//mongoose"

Should we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants