Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NX 20 : react and js generators are not working with typescript 4.9.5 #28934

Open
1 of 4 tasks
abarghoud opened this issue Nov 14, 2024 · 0 comments
Open
1 of 4 tasks

Comments

@abarghoud
Copy link

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 error

NX Cannot read properties of undefined (reading 'JsxEmit')

Expected Behavior

Should not generate the library

GitHub Repo

No response

Steps to Reproduce

  1. Create an NX monorepo
  2. Add @nx/js
  3. Make sure typescript version is 4.9.5
  4. Run yarn nx g @nx/js:library --name=hello --no-interactive --dry-run --directory=packages

Nx Report

Node           : 20.11.1
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.22.22

nx                 : 20.1.0
@nx/js             : 20.1.0
@nx/eslint         : 20.1.0
@nx/workspace      : 20.1.0
@nx/devkit         : 20.1.0
@nx/eslint-plugin  : 20.1.0
@nx/react          : 20.1.0
@nx/vite           : 20.1.0
@nx/web            : 20.1.0
typescript         : 4.9.5
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin

Failure Logs

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

Package Manager Version

1.22.22

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

After digging into it, I think it caused by this modification 49c5a73#diff-842db87f6a6e9b32a7f1343a67bc63af9676b4ae0a418ced46628461d3070eb4R56

Where we do ts.server.protocol.JsxEmit while protocol in [email protected] is undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant