yet the compiled output of that Test.res modle appears to depend on the suffix setting within the end-developers bsconfig.json file.
Therefore, if a developer installs rescript-test, finds out that it doesn't support the .bs.js suffixed files that actually contain ES6 import statements (which rescript currently outputs), and then attempts to fix that by changing suffix to .mjs within bsconfig.json, they will instead get this error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/dominic.chambers/dev/proj/node_modules/rescript-test/src/Test.mjs' imported from /Users/dominic.chambers/dev/proj/node_modules/rescript-test/bin/retest.mjs
at new NodeError (internal/errors.js:322:7)
at finalizeResolution (internal/modules/esm/resolve.js:308:11)
at moduleResolve (internal/modules/esm/resolve.js:731:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
at Loader.resolve (internal/modules/esm/loader.js:89:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
at Loader.import (internal/modules/esm/loader.js:177:28)
at importModuleDynamically (internal/modules/esm/translators.js:114:35)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at file:///Users/dominic.chambers/dev/proj/node_modules/rescript-test/bin/retest.mjs:42:41 {
code: 'ERR_MODULE_NOT_FOUND'
}
Likely unbeknownst to the developer, this can actually be mitigated by deleting node_modules\rescript-test, and running yarn or npm install again, at which point it will re-build the Test module using the now appropriate settings within bsconfig.json.
First of all, thank you so much for taking the time to create this library 🙏.
rescript-test/bin/retest.mjs
uses the inferred suffix when loading its ownTest
module:yet the compiled output of that
Test.res
modle appears to depend on thesuffix
setting within the end-developersbsconfig.json
file.Therefore, if a developer installs
rescript-test
, finds out that it doesn't support the.bs.js
suffixed files that actually contain ES6import
statements (whichrescript
currently outputs), and then attempts to fix that by changingsuffix
to.mjs
withinbsconfig.json
, they will instead get this error:Likely unbeknownst to the developer, this can actually be mitigated by deleting
node_modules\rescript-test
, and runningyarn
ornpm install
again, at which point it will re-build theTest
module using the now appropriate settings withinbsconfig.json
.