diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-01 02:07:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 07:07:11 +0100 |
commit | 8698492128310f713993bb115985d41d3fdca2db (patch) | |
tree | 8d278c37c815eae7e816f7dc10fc51c1d5c2ec4e /ext/node/resolution.rs | |
parent | b8af46e0075f659f4e373e249b0f19b3cb0f62a9 (diff) |
fix(node): handle empty 'main' entry in pkg json (#23155)
Diffstat (limited to 'ext/node/resolution.rs')
-rw-r--r-- | ext/node/resolution.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index d878a5059..50c4e2bb5 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -1232,7 +1232,7 @@ impl NodeResolver { ) -> Result<Option<ModuleSpecifier>, AnyError> { let maybe_main = if mode.is_types() { match package_json.types.as_ref() { - Some(types) => Some(types), + Some(types) => Some(types.as_str()), None => { // fallback to checking the main entrypoint for // a corresponding declaration file |