You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on following this blog, I was trying to directly link my internal packages by changing the package.json exports as follows and removing the build step.
"exports": {
"./*": "./src/*.ts"// instead of "./dist/*.js"
},
"typesVersions": {
"*": {
"*": ["./src/*"] // instead of "./dist/*"
}
},
I am able to run my mocha test suite on the cli without any issue. My mocha config file is as follows
module.exports={"node-option": ["experimental-specifier-resolution=node","loader=esbuild-node-loader"// works with ts-node/esm also. I prefer esbuild-node-loader since it has built-in support for path alias.],"require": ["dotenv/config","./tests/helpers/globalSetup.js","chai/register-should"],};
However, when I run the same test in wallaby, it throws following error.
Runtime error: TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "file://./libs/store/src/SupabaseConnection.ts"
at new NodeError (node:internal/errors:371:5)
at ESMLoader.load (node:internal/modules/esm/loader:324:13)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:230:47)
This error disappears if I reintroduce typescript compilation step for internal packages.
Direct linking simplifies my development time significantly as I can completely skip build time for internal packages. Any help here will be very much appreciated.
Can you please create a sample project repo with the working mocha setup (as you want it to work ideally) and we'll take a look to see how to configure the same thing in Wallaby? If you like, you may combine the sample repo with the other issue you've raised #2910.
Issue description or question
Based on following this blog, I was trying to directly link my internal packages by changing the package.json
exports
as follows and removing the build step.I am able to run my mocha test suite on the cli without any issue. My mocha config file is as follows
However, when I run the same test in
wallaby
, it throws following error.This error disappears if I reintroduce typescript compilation step for internal packages.
Direct linking simplifies my development time significantly as I can completely skip build time for internal packages. Any help here will be very much appreciated.
Wallaby diagnostics report
The text was updated successfully, but these errors were encountered: