Compilation errors referencing index.js? #2266
|
Trying to understand if this is intended behavior.... As of 3.0.57 the compilation error message changed from referencing the sqlx file to something called "index.js". Is this expected? When running 3.0.56 |
Answered by
rafal-hawrylak
Sep 2, 2026
Replies: 1 comment 3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirmed - this is a regression. Opened #2271 with a fix.
Root cause: the vm2 bump (3.10.2 → 3.11.3) in #2168 changed how V8 CallSite objects behave inside the sandbox: they no longer carry file paths. The CLI has a global.__dataform_current_file fallback for exactly this case, but it's set/reset per module load - by the time a sqlx action's callback runs (during Session.compile), that global has been restored to the sandbox entry (index.js). So every ref()/Session.resolve failure got attributed to index.js instead of the calling .sqlx file.
Fix: track the current action's file on the Session while its callback is compiled, and use it in compileError() when no explicit path was passed. N…