-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Most nx cli commands fail when @nx/storybook attempts parse storybook's main.ts #23228
Comments
This is going to require more thought. Trying to get |
Thanks for your help :) |
Is there any known workaround other than removing the plugin or reverting the version? |
Getting the same issue moving from 18.3.3 to 19.2.1. Seems like the issue is still persisting |
Credit to @jaysoo who figured this out. I've tested the fix out on the repro repo provided, and it works :) @RyanClementsHax once this is merged, expect it to be released either this week or next |
…ESM (#27862) When we load `.ts` files and the closest `package.json` specifies `"type": "module"`, then the file may error upon loading. This happens because we're not setting `compilerOptions` correctly when registering `ts-node/esm`-- in fact there is no way to pass options through this hook. This PR sets defaults on `TS_NODE_COMPILER_OPTIONS` such that the `module` and `moduleResolution` are correct values for ESM. It also works for CJS since both `module` and `moduleResolution` check the closest `package.json` to determine the format. ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23228
…ESM (#27862) When we load `.ts` files and the closest `package.json` specifies `"type": "module"`, then the file may error upon loading. This happens because we're not setting `compilerOptions` correctly when registering `ts-node/esm`-- in fact there is no way to pass options through this hook. This PR sets defaults on `TS_NODE_COMPILER_OPTIONS` such that the `module` and `moduleResolution` are correct values for ESM. It also works for CJS since both `module` and `moduleResolution` check the closest `package.json` to determine the format. ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #23228 (cherry picked from commit 7232b39)
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Most nx commands fail
Expected Behavior
Nx commands can be run
GitHub Repo
https://github.com/RyanClementsHax/nx-storybook-repro
Steps to Reproduce
npm install
npx nx serve web-client --verbose
Nx Report
Failure Logs
Package Manager Version
10.5.1
Operating System
Additional Information
I'm on WSL Ubuntu 20.04
Node: v20.11.0
I was able to track down that the specific version that breaks this is 18.3.4. Given the error message, I imagine it is related to #22953
The text was updated successfully, but these errors were encountered: