diff --git a/src/node_modules.cc b/src/node_modules.cc index ffe9fdf3f2ccdf..5cf563dab5be29 100644 --- a/src/node_modules.cc +++ b/src/node_modules.cc @@ -160,9 +160,20 @@ const BindingData::PackageConfig* BindingData::GetPackageJSON( return throw_invalid_package_config(); } } else if (key == "main") { - if (value.get_string(package_config.main)) { + if (value.type().get(field_type)) { return throw_invalid_package_config(); } + switch (field_type) { + case simdjson::ondemand::json_type::boolean: + // Boolean values are omitted. + break; + default: { + if (value.get_string(package_config.main)) { + return throw_invalid_package_config(); + } + break; + } + } } else if (key == "exports") { if (value.type().get(field_type)) { return throw_invalid_package_config();