If the action being tested contains paths settings, the CLI fails with a not-very-friendly error like the following:
/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
src/index.ts:4:21 - error TS2307: Cannot find module 'main' or its corresponding type declarations.
4 import { run } from 'main'
~~~~~~
at createTSError (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions.<computed> [as .ts] (/Users/mona/.nodenv/versions/20.6.0/lib/node_modules/ts-node/src/index.ts:1621:12)
at Object.require.extensions.<computed> (/Users/mona/Workspace/mona/local-action/node_modules/proxyquire/lib/proxyquire.js:311:43)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12) {
diagnosticCodes: [ 2307 ]
}
I believe this can be fixed with tsconfig-paths in this project's configuration :)
If the action being tested contains paths settings, the CLI fails with a not-very-friendly error like the following:
I believe this can be fixed with
tsconfig-pathsin this project's configuration :)