Closed mitom18 closed 3 years ago
Hi @mitom18 ! Thanks for filing this bug! I think this can be fixed by doing a check for if the os is windows and then not include "file://" string to the parse path method as it works on mac and linux. Would you be able to submit a PR with this change?
Thanks for quick response @halvardssm ! I tried to remove the "file://" string on Windows. The problem with exists(this.configFile)
is solved, however, the import(this.configFile)
is not working without the "file://" prefix (https://github.com/halvardssm/deno-nessie/blob/main/cli/state.ts#L31,L32). Looks like Deno bug, I will open an issue in their repo.
Thanks for checking this out! Can you reference the issue you open here as well? Might be worth doing a workaround for now, but I am not sure when I will have time to sit down and work on it this week.
Sure, here is the link denoland/deno#10266. I might have some time at the end of the week, will try to work it out. 🙂
@halvardssm So in the end, a fix is needed on deno-nessie site. There is apparently a difference between file path and URL when they are used as strings. Import function is needing URL form and Deno.lstat is needing the file path form. One approach could be that nessie works with URL objects instead of strings (https://github.com/denoland/deno/issues/10266#issuecomment-823208275). Or strings can be used, but the "file://" string prefix should be used only in import function calls, not in exists calls. Which sounds better?
System:
Error when running
deno run -A --unstable https://deno.land/x/nessie/cli.ts migrate -c .\nessie.config.ts
Error is caused by this line. Looks like Deno has problem reading file path with the
file://
prefix. The problem can be reproduced with the following code:No problems on Linux, however.