Skip to content

Commit

Permalink
module: disable require(esm) for policy and network import
Browse files Browse the repository at this point in the history
These features are already removed since v22. There is no point
supporting them to work with require(esm) in v20.

PR-URL: #56927
Refs: #52697
Reviewed-By: Marco Ippolito <[email protected]>
  • Loading branch information
joyeecheung authored and marco-ippolito committed Feb 11, 2025
1 parent de313b2 commit ed2d373
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors,
}
}

if (!experimental_policy.empty() || experimental_https_modules) {
require_module = false;
}

if (!type.empty()) {
if (type != "commonjs" && type != "module") {
errors->push_back("--experimental-default-type must be "
Expand Down

0 comments on commit ed2d373

Please sign in to comment.