Open bojavou opened 1 week ago
@nodejs/loaders
I just tested this in the browser and it does not work in Chrome - therefore this is a V8 issue.
I'd strongly encourage you to post a Chromium bug here further.
I'd like to report it but I can't submit there as it requires a Google account.
Version
v22.4.0
Platform
Subsystem
loaders
What steps will reproduce the bug?
This set of files reproduces. Execute
entry.mjs
to observe.This line embeds the above files in a graph of data URLs to reproduce in a snippet. Firefox also succeeds on this one.
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
Different paths to the same module namespace should be disambiguated and load successfully.
This is the behavior specified in ECMAScript:
The relevant logic is
ResolveExport
. This line toward the bottom defines the star export / namespace interaction:If either but not both are
namespace
, it's ambiguous. If both arenamespace
the end result is to disambiguate and consider them identical.Node.js does disambiguate values within modules:
Firefox also disambiguates module namespaces. This file succeeds:
What do you see instead?
SyntaxError: The requested module './aggregate.mjs' contains conflicting star exports for name 'substance'
Additional information
There's a GitHub repo here with discussion.
https://github.com/bojavou/disambiguate-namespace