Description
I've stumbled upon a crash trying to start a Nuxt 3-based project in a subdirectory of a Nuxt 2 project.
So the main Nuxt 2 project at /project/
and a Nuxt 3-based docs
subdirectory at /project/docs
. This crashes due to nuxt
dependency from the root project getting picked up.
It seems the issue is in this code:
Lines 75 to 79 in 6327ad8
This _resolve
function receives an id
parameter with a nuxt
value.
It creates url
with the value of the current working directory so /project/docs
.
Then new URL("./", url)
actually resolves to the /project/
directory instead of /project/docs
which seems very much not expected to me.
Try this in a browser:
new URL('./', 'file:///project/docs').href
"file:///project/"
(Same for the new URL("node_modules", url)
line above which seems to be scheduled for removal at some point)