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

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal #281

Closed
RaknaX opened this issue Jul 9, 2019 · 5 comments
Closed

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal #281

RaknaX opened this issue Jul 9, 2019 · 5 comments

Comments

@RaknaX
Copy link

RaknaX commented Jul 9, 2019

I am getting this error:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. 1: node_module_register 2: v8::V8::ToLocalEmpty 3: Require 4: Integer::Init 5: RegisterModule 6: node_module_register 7: v8::internal::wasm::SignatureMap::Find 8: v8::internal::Builtins::CallableFor 9: v8::internal::Builtins::CallableFor 10: v8::internal::Builtins::CallableFor 11: 0000038B7FD043C1

How to solve?

@JoshuaWise
Copy link
Member

It can't find the integer module, which is a dependency of better-sqlite3. Try deleting your node_modules and reinstalling from scratch.

@JoshuaWise
Copy link
Member

This should be fixed in the latest version of better-sqlite3 (v6.0.1).

@EpoHub
Copy link

EpoHub commented Mar 8, 2020

Issue still exist on 32-bit package (version 6.0.1)
Node 64-bit + npm install beter-sqlite3 --arch=x64 (work without issue)
Node 32-bit + npm install beter-sqlite3 --arch=ia32 (still give fatal error)

@JoshuaWise
Copy link
Member

This is fixed in v7.0.0.

@achou11
Copy link

achou11 commented Jul 14, 2022

Looks like I'm running into a similar error. Let me know if I should open a new issue.

Node version: 12.18.3
better-sqlite3 version: 7.5.3
OS: MacOS 11.6.7 (Big Sur), Intel

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 0x1011c2ff5 node::Abort() (.cold.1) [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 2: 0x10009fbc9 node::Abort() [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 3: 0x10009fd2f node::OnFatalError(char const*, char const*) [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 4: 0x1001e60e0 v8::V8::ToLocalEmpty() [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 5: 0x106807e46 Database::ThrowSqliteError(Addon*, char const*, int) [/Users/andrewchou/GitHub/digidem/mapeo-map-server/node_modules/better-sqlite3/build/Release/better_sqlite3.node]
 6: 0x1068092a1 Statement::JS_run(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/andrewchou/GitHub/digidem/mapeo-map-server/node_modules/better-sqlite3/build/Release/better_sqlite3.node]
 7: 0x10024f438 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 8: 0x10024e9f9 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
 9: 0x10024e162 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
10: 0x1009d3ab9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
11: 0x100959364 Builtins_InterpreterEntryTrampoline [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
12: 0x100959364 Builtins_InterpreterEntryTrampoline [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]
13: 0x100959364 Builtins_InterpreterEntryTrampoline [/Users/andrewchou/Library/Caches/fnm_multishells/17210_1657814232551/bin/node]

Haven't figured out a minimal reproduction but can make note of the thing that seems to cause it. I have a set of 4 statements that are run within a transaction (better-sqlite3 transaction, not hardcoded). There are other statements in this transaction, but this set seems to be causing issues. The nature of the statements are as follows:

  1. Create a view. This does a join on a subquery and uses some basic json_each stuff
  2. Delete some records using view from (1) to do a subquery for the where clause
  3. Similar to (2) but deleting from a different table
  4. Drop view

Other important notes:

  • WAL mode is enabled
  • Seeing this failure when in the context of tests that I'm running (using tape + ts-node)

Entirely possible that this is a red herring. Also, could be approaching this in a non-idiomatic way and maybe there's a better way of doing the above that avoids the issue. Maybe using a CTE might be a better approach, although it seemed to be much slower than using a view since it has to be run for each deletion statement.

Apologies for not having a minimum repro available, but will try for a bit and see if I can create one

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

No branches or pull requests

4 participants