Closed MichaelSitter closed 2 months ago
Hi Michael! Thanks for reporting this to us and the useful reproduce repository looks great to me!
I can see you are using Node.js 20 in your repository, the temporary workaround is adding a tsconfig.json
file in your monorepo root.
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Node 20",
"_version": "20.1.0",
"compilerOptions": {
"lib": ["es2023"],
"module": "node16",
"target": "es2022",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node16"
}
}
I would like to elaborate a little bit more if you are interested. Your investigation on the TemplateConfiguration
is right. The problem is the latest stable version of ts-node
has not supported Node.js > 16 yet. So it might not work well with the latest Node.js version.
Fortunately, ts-node
is working on this! There is a new beta version of ts-node@11
. With this beta version, ts-node
can work well with Node.js 18 and 20. Ref: https://github.com/TypeStrong/ts-node/issues/2077
I will release a new version of the rush-init-project-plugin
after the ts-node@11
was released as stable version.
The temporary workaround is adding a tsconfig.json
manually under the root of monorepo. That makes the ts-node
gets the correct tsconfig.json
for Node.js 20.
The content of this tsconfig.json
comes from @tsconfig/node20.
Update: rush-init-project-plugin@0.10.0-beta.0 has been released. It uses ts-node@11
beta version.
thanks @chengcyber!!! i'll pull it in & test it on my side.
@MichaelSitter if the problem is resolved, should we close this issue?
If you use the documented setup for
init.config.ts
, the plugins internal ts-node build fails with the following error:I think I managed to track the failure down to this line in TemplateConfiguration. I experimentally added
module: 'none'
& it resolves this issue, but it's not clear to me what should actually be happening here. Is ts-node supposed to be discovering a tsconfig file at this step, or is this intentionally hardcoded in the plugin?I have a branch which reproduces this issue here: https://github.com/MichaelSitter/web-projects/tree/rush-init-project-ts-config-repro