🐛 BUG: relative imports from a nested main
in base_dir
breaks
#6353
Labels
bug
Something that isn't working
main
in base_dir
breaks
#6353
Which Cloudflare product(s) does this pertain to?
Wrangler
What version(s) of the tool(s) are you using?
3.67.1 [Wrangler]
What version of Node are you using?
v20.9.0
What operating system and version are you using?
macOS 14.5 (23F79)
Describe the Bug
Observed behavior
./some/base_dir/nested/index.js
./some/base_dir/foo.js
./wrangler.toml
npx wrangler dev
collectsfoo.js
as an additional module, but errors withExpected behavior
I'm able to import from a parent when
base_dir
includes those modules.I suspect what is happening is that we correctly attach additional modules with their relative path to
base_dir
(e.g./foo.js
), but the main entry path is being incorrectly set as/index.js
rather than/nested/index.js
, so relative imports from there are busted.Steps to reproduce
As above.
Changing the import to
import { x } from "/foo.js";
"fixes" the issue, hence my theory on how we're setting the current module path.Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
No response
The text was updated successfully, but these errors were encountered: