Open VanyaMate opened 5 months ago
Unfortunately, such errors occur in other parts as well. For example, I cannot start the server for the same reason via npm run dev.
Unfortunately, I couldn't quickly figure out what the problem was. The first problem is also related to pathname. When I remove this code, the problem goes away, but the next one appears.
The second problem is also related to paths, but it has something to do with absolute paths in Windows, as I understand it. But this is not a fact.
I updated both npm and node to the latest versions, the problem remained. I have windows 10.
Thanks for digging in and having a look! Are you able to help me out a bit, I don't have access to windows right now:
import.meta.url
for you?new URL('.', import.meta.url).pathname
path.join(modDir, '../package.json')
I just want to check what the discrepancies for these are on windows vs osx, then I should be able to fix it.
There are a few places we rely on import.meta.url
in the code base so they will all need to be updated, most likely.
@ashconnell Hi, sorry, I didn't notice the message right away.
Yes, sure. Paths for in packages/create-firebolt/src/index.
import.meta.url: file:///C:/dev/opensource/firebolt/packages/create-firebolt/src/index.js
new URL(".", import.meta.url).pathname: /C:/dev/opensource/firebolt/packages/create-firebolt/src/
path.join(modDir, "../package.json"): \C:\dev\opensource\firebolt\packages\create-firebolt\package.json
And because of the "\" at the beginning of \C:\dev... i get this error where C:\ is added to the beginning again
but if you remove the "\" the paths become normal and there is no error.
Similar problems are found in other places. For the same reason I can't start the dev server, for example.
Hello. I tried to create the application using npm create firebolt@latest but failed due to an error with the paths.
When calling new URL('.', import.meta.url).pathname, I received a path that starts with the "/" character. Because of this, in the future, with path.join, the disk was added to the beginning again.
If you remove the "/" the error disappears and everything works.