-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the js.commonjs-core-modules-replacements
module matching being overly agressive?
#706
Comments
The |
I tried to reproduce this issue i.e. I tried to run a basic I installed (using I installed some other packages to help me replace core Node.js modules:
I used the following simple test-suite (placed it into
I used the following script (placed in
Finally, I use the following command line to execute the result. I am aware that you want to use Context API, not a command line but it should be trivial to rewrite this to Context API.
and got
I used GraalVM CE Java17 22.3.1. |
I'm trying to execute Mocha under graaljs in "Java Bindings mode" (Context API).
Mocha expects a series of Node APIs I'm providing through the
js.commonjs-core-modules-replacements
option as per the documentation.In
mocha/lib/runnable.js
there is the following import statement:var utils = require('./utils');
One of the core modules I'm replacing is
util
. Somehow, graal perceives./utils
to be the same asutil
and imports the replacement module instead of the local Mocha file. (I know this because I overwroteFileSystem::checkAccess
in order to see all files being probed by graal)I tried searching for the code that handles the
js.commonjs-core-modules-replacements
option and figure out why this behaviour is happening with no luck.The text was updated successfully, but these errors were encountered: