Closed CroniD closed 1 year ago
Update: Also doesn't work with NodeJS 18.12.x (LTS). Problems are the same. Paths and URIs getting mixed up, which causes errors, when running on Windows. :(
PR welcome if you want to submit a fix and also tests for Windows specifically
PR welcome if you want to submit a fix and also tests for Windows specifically
Done. :)
v9.1.3 released to npm, please try again with this version! thank you for the PR.
@titanism Thank you. It works. :)
Describe the bug
Node.js version: 16.x LTS
OS version: Windows 10
Description:
Using one of the following options for
root
Path.resolve('src/jobs')
Path.join(__dirname, 'jobs')
leads to an error.(also the default doesn't work)
Actual behavior
(I've cut
logger
androot
a bit)Expected behavior
It should work.
Code to reproduce
Checklist
Analysis
Bree uses the
import()
function, which accepts URLs, butroot
is given as a path. Doesn't matter for unix-like systems, but it does on windows. Using a file-URL forroot
(e.g.Url.pathToFileURL(Path.join(__dirname, 'jobs')).toString()
) stops at https://github.com/breejs/bree/blob/master/src/index.js#L209 becausestat
expects a path, if given as string, not a file-URL as string.Error looks like
I guess, if the given path is always transformed to a URL via
Url.pathToFileURL(...).toString()
before passing it toimport(...)
that might solve the issue, but I don't know if this will work out for unix-like systems as well.