Skip to content

require/load - Error loading JavaScript Module with ES4X in maven project #597

@iskane

Description

@iskane

We have a polyglot application with Vertx 3 and vertx-lang-js and we are migrating to Vertx 4 and ES4X.
In lot of javaScripts we load other scripts that are in the classpath using require/load. for example:
var myvar = require('com/xxxx/yyyy/common/scripts/lodash.js')

Using Java 11, GraalVM and the ES4X dependency in our maven project, we have the following error when we load a javaScript module in a jar in the class path:

"ModuleError: Module "com/xxxx/yyyy/common/scripts/lodash.js"
was not found\r\n\tat Require.resolve(..\..\..\..\..\maven-local-repository\io\reactiverse\es4x\0.19.1\es4x-0.19.1.jar!\io\reactiverse\es4x\jvm-npm.js:122:3628-3706)

it’s possible with ES4X to resolve the class path and load a JavaScript file/module in a jar?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions