reactiverse / es4x

🚀 fast JavaScript 4 Eclipse Vert.x
https://reactiverse.io/es4x/
Apache License 2.0
877 stars 75 forks source link

Module path resolution for js & mjs verticle factories fails on windows #556

Closed chefhoobajoob closed 2 years ago

chefhoobajoob commented 2 years ago

See reproducer here, using es4x 0.15.0: https://github.com/chefhoobajoob/es4x-graal-js-error-reproducer

For some reason, the mjs verticle factory is able to load the entry module if it has a .js file extension, but otherwise both factories are unable to resolve module paths when launching an es4x module or, if the module does get loaded and includes require or import statements, to resolve those paths.

pmlopes commented 2 years ago

the internal usage of URIs to refer to module paths seem to be incorrect on windows where slashes are mixed and drive leters miss a prefix extra /.

Running tests on windows seem to show for example:

file://N:\reactiverse\es4x\somefile.js

Where it should read:

file:///N:/reactiverse/es4x/somefile.js
chefhoobajoob commented 2 years ago

Is the code that's generating those file uri's with mixed slashes coming from graalvm, or are they under es4x/vertx control? new File(absolutePath).toURI() would probably do it

pmlopes commented 2 years ago

This was fixed on 0.16.0