NX Cannot read properties of undefined (reading 'JsxEmit')
TypeError: Cannot read properties of undefined (reading 'JsxEmit')
at getNeededCompilerOptionOverrides (./node_modules/@nx/js/src/utils/typescript/configuration.js:31:49)
at createProjectTsConfigs (./node_modules/@nx/js/src/generators/library/library.js:686:88)
at createFiles (./node_modules/@nx/js/src/generators/library/library.js:334:5)
at libraryGeneratorInternal (./node_modules/@nx/js/src/generators/library/library.js:43:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ./node_modules/nx/src/command-line/generate/generate.js:240:26
at async handleErrors (./node_modules/nx/src/utils/handle-errors.js:8:24)
at async Object.handler (./node_modules/nx/src/command-line/generate/command-object.js:13:22
Current Behavior
When running
yarn nx g @nx/js:library --name=hello --no-interactive --dry-run --directory=packages
on a monorepo with nx@20, I am getting this errorNX Cannot read properties of undefined (reading 'JsxEmit')
Expected Behavior
Should not generate the library
GitHub Repo
No response
Steps to Reproduce
yarn nx g @nx/js:library --name=hello --no-interactive --dry-run --directory=packages
Nx Report
Failure Logs
Package Manager Version
1.22.22
Operating System
Additional Information
After digging into it, I think it caused by this modification https://github.com/nrwl/nx/commit/49c5a73cd04b602d6b71c48713d6d76b745531a1#diff-842db87f6a6e9b32a7f1343a67bc63af9676b4ae0a418ced46628461d3070eb4R56
Where we do
ts.server.protocol.JsxEmit
while protocol in typescript@4.9.5 is undefined