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

_loadDialectModule hides original MODULE_NOT_FOUND exception which makes debugging very difficult #15657

Closed
fedulovivan opened this issue Feb 7, 2023 · 4 comments

Comments

@fedulovivan
Copy link

There are a lot of issues here, with text like Please install sqlite3 package manually or Unable to find dialect at sqlite3 (sqlite3 may be replaced with pg or any other, this does not matter, actually).

So this was also my case, I have faced with weird error, saying "sqlite3" package is missing. I have ensured it is in package.json, then checked node_modules/sqlite3 - all ok, but issue still present.
Almost all items in this repo contain advises with some magical steps like using npm rebuild, or steps leading to package reinstall. This obviously looks weird..

So, after several hours of debugging I have found a real RCA for the problem in my particular case. Instruction require("sqlite3") throwed an exception Cannot find module '/app/node_modules/sqlite3/lib/binding/napi-v6-linux-musl-arm64/node_sqlite3.node' (that was caused by wrong Dockerfile on my side, and using different distributive to compile and run application). But the problem is, _loadDialectModule hides an original exception thrown by node.js runtime.

So, please consider using following exception text: "Unable to load sqlite3 package due to error: Cannot find module '/app/node_modules/sqlite3/lib/binding/napi-v6-linux-musl-arm64/node_sqlite3.node'", and do not hide original exception, which may not be caused by simple absence of node_modules/sqlite3.

@fedulovivan fedulovivan added pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet type: bug labels Feb 7, 2023
@ephys ephys removed the pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet label Feb 7, 2023
@geeksesi
Copy link

please, could you explain about "that was caused by wrong Dockerfile on my side, and using different distributive to compile and run application".

@fedulovivan
Copy link
Author

@geeksesi please check this comment

@ephys
Copy link
Member

ephys commented Mar 27, 2024

_loadDialectModule is no longer used following the extraction of dialects to their own packages #13722 (v7)

@ephys
Copy link
Member

ephys commented Apr 11, 2024

Sequelize 7 alpha 40 has been released which fixes this issue. As this is not something we can change for v6, I'll close this issue as resolved

@ephys ephys closed this as completed Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants