-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Bug: binding
resolves wrong path
#24462
Comments
Simpler reproduction: import * as sql3 from "sqlite3";
console.log(sql3) EDIT: These are the paths that are looked up in Node vs Deno inside the Node (npm):
/Users/marvinh/dev/test/deno-sqlite3/node_modules/sqlite3
/Users/marvinh/dev/test/deno-sqlite3/node_modules/sqlite3/lib/sqlite3-binding.js
Node (pnpm):
/Users/marvinh/dev/test/deno-sqlite3/node_modules/.pnpm/sqlite3@5.1.7/node_modules/sqlite3
/Users/marvinh/dev/test/deno-sqlite3/node_modules/.pnpm/sqlite3@5.1.7/node_modules/sqlite3/lib/sqlite3-binding.js
Deno:
/Users/marvinh/dev/test/deno-sqlite3/node_modules/.deno/bindings@1.5.0/node_modules/bindings
/Users/marvinh/dev/test/deno-sqlite3/node_modules/.deno/bindings@1.5.0/node_modules/bindings/bindings.js |
binding
resolves wrong path in sqlite3 repobinding
resolves wrong path
Ah the Error.prepareStackTrace = function(e, st) {
for (var i = 0, l = st.length; i < l; i++) {
fileName = st[i].getFileName();
// Here we compare file://foo/bar.js with /foo/bar.js in Deno and bail out too early
if (fileName !== __filename) {
if (calling_file) {
if (fileName !== calling_file) {
return;
}
} else {
return;
}
}
}
}; |
We discussed this and came to an agreement that there are two potential approaches:
I'll explore the first approach, and if that doesn't work out we can try the runtime patch. |
Adds support for `npm:bindings` and `npm:callsites` packages because of changes in denoland/deno_core#838. This `deno_core` bump causes us to stop prepending `file://` scheme for locations in stack traces that are for local files. Fixes #24462 , fixes #22671 , fixes #15717 , fixes #19130 , fixes WiseLibs/better-sqlite3#1205 , fixes WiseLibs/better-sqlite3#1034 , fixes #20936 --------- Co-authored-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
Looks like we're looking for the wrong paths or maybe need to look at an additional path. This works in Node.
Steps to reproduce
npm i && npm run install
node test/support/createdb.js
DENO_FUTURE=1 deno run -A npm:mocha -R spec --timeout 480000
The file it's looking for is located at:
/Users/marvinh/dev/oss/node-sqlite3/build/Release/node_sqlite3.node
Version: Deno 1.44.4
The text was updated successfully, but these errors were encountered: