[build] TypeScript environment somehow changed, TypeScript target failing
kaby76 opened this issue · comments
Builds for testing the TypeScript target get the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\msys64\home\Kenne\issues\g4-3880\abb\Generated-TypeScript\abbLexer' imported from C:\msys64\home\Kenne\issues\g4-3880\abb\Generated-TypeScript\Test.js
Did you mean to import ../abbLexer.js?
at finalizeResolution (node:internal/modules/esm/resolve:264:11)
at moduleResolve (node:internal/modules/esm/resolve:917:10)
at defaultResolve (node:internal/modules/esm/resolve:1130:11)
at nextResolve (node:internal/modules/esm/hooks:749:28)
at resolve (C:\Users\kenne\AppData\Roaming\npm\node_modules\ts-node\dist\child\child-loader.js:15:125)
at nextResolve (node:internal/modules/esm/hooks:749:28)
at Hooks.resolve (node:internal/modules/esm/hooks:237:30)
at handleMessage (node:internal/modules/esm/worker:199:24)
at checkForMessages (node:internal/modules/esm/worker:141:28)
at process.<anonymous> (node:internal/modules/esm/worker:160:5) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///C:/msys64/home/Kenne/issues/g4-3880/abb/Generated-TypeScript/abbLexer'
}
Fortunately, the fix is easy. Change these lines to generate this:
import abbLexer from './abbLexer.js';
import abbParser from './abbParser.js';
The Issue is fixed with PR #3883.
But, I am now interested in why the TypeScript environment suddenly failed.
- There is no explicit "setup typescript" as with every other target. https://www.google.com/search?q=github+actions+setup+typescript&rlz=1C1NDCM_enUS742US742&oq=github+actions+setup+typescript&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQRRhA0gEIODg3MWowajeoAgCwAgA&sourceid=chrome&ie=UTF-8
- I don't understand how it was installed. There should be zero base support for TypeScript out of the box for any OS.
- Somewhere, someone did a
npm install -g typescript
https://code.visualstudio.com/docs/typescript/typescript-compiling#:~:text=Tip%3A%20To%20get%20a%20specific,save%2Ddev%20typescript%40next%20. - Ah. I see now. This: and . No, we need to install a specific version of TypeScript!