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
I tried to run lab on my typeScript project both by npx lab --typescript and npx lab --sourcemaps --transform node_modules/lab-transform-typescript
In both cases I receive the error below.
I do have an import { messageFormat } from "src/util/messageFormat";
in a file imported by test/runAllContracts.test.ts.
I could change it to relative import, but vscode in some cases inserts a nonrelative import even though it is configured to insert relative ones. And anyway,
as I have "baseUrl": "./", in my tsconfig.json, I would have expected nonrelative imports to work for all tools.
How can I get lab to follow nonrelative imports?
Error requiring file: /home/mag/project/KodeKonveyor/cdd-ts/test/runAllContracts.test.ts
Cannot find module 'src/util/messageFormat'
Require stack:
- /home/mag/project/KodeKonveyor/cdd-ts/src/runner/runContractsfromList.ts
- /home/mag/project/KodeKonveyor/cdd-ts/src/runner/runAllContracts.ts
- /home/mag/project/KodeKonveyor/cdd-ts/test/runAllContracts.test.ts
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/mo-walk/lib/index.js
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/cli.js
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/bin/lab
Error: Cannot find module 'src/util/messageFormat'
Require stack:
- /home/mag/project/KodeKonveyor/cdd-ts/src/runner/runContractsfromList.ts
- /home/mag/project/KodeKonveyor/cdd-ts/src/runner/runAllContracts.ts
- /home/mag/project/KodeKonveyor/cdd-ts/test/runAllContracts.test.ts
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/mo-walk/lib/index.js
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/cli.js
- /home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/bin/lab
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
at Function.Module._load (node:internal/modules/cjs/loader:934:27)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/home/mag/project/KodeKonveyor/cdd-ts/src/src/runner/runContractsfromList.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Object.require.extensions.<computed> [as .ts] (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/modules/transform.js:41:28)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Function.Module._load (node:internal/modules/cjs/loader:972:12)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/home/mag/project/KodeKonveyor/cdd-ts/src/src/runner/runAllContracts.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Object.require.extensions.<computed> [as .ts] (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/modules/transform.js:41:28)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Function.Module._load (node:internal/modules/cjs/loader:972:12)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/home/mag/project/KodeKonveyor/cdd-ts/test/runAllContracts.test.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Object.require.extensions.<computed> [as .ts] (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/modules/transform.js:41:28)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Function.Module._load (node:internal/modules/cjs/loader:972:12)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.internals.tryToResolveCJS (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/mo-walk/lib/index.js:144:17)
at Object.exports.tryToResolve (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/mo-walk/lib/index.js:106:22)
at Object.internals.traverse (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/cli.js:152:39)
at Object.exports.run (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/lib/cli.js:61:21)
at main (/home/mag/project/KodeKonveyor/cdd-ts/node_modules/@hapi/lab/bin/lab:56:22)
The text was updated successfully, but these errors were encountered:
Support plan
Context
package.json:
tsconfig.json:
How can we help?
I tried to run lab on my typeScript project both by
npx lab --typescript
andnpx lab --sourcemaps --transform node_modules/lab-transform-typescript
In both cases I receive the error below.
I do have an
import { messageFormat } from "src/util/messageFormat";
in a file imported by
test/runAllContracts.test.ts
.I could change it to relative import, but vscode in some cases inserts a nonrelative import even though it is configured to insert relative ones. And anyway,
as I have
"baseUrl": "./",
in my tsconfig.json, I would have expected nonrelative imports to work for all tools.How can I get lab to follow nonrelative imports?
You can find the current state of my project at https://github.com/kode-konveyor/cdd-ts/tree/bugreport/lab
The text was updated successfully, but these errors were encountered: