Open edbzn opened 2 months ago
Hey @edbzn Could you try this on an Angular CLI workspace? The @storybook/angular builder is not an Nx executor, it's owned by the storybook team, and it would be nice to isolate if this is 100% related to Nx.
This issue has been automatically marked as stale because more information has not been provided within 7 days. It will be closed in 21 days if no information is provided. If information has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Full stacktrace from the same issue in our codebase. The interesting part is probably inside the preset.js file where they require() 'rehype-external-links', Their own code is in typescript, but distributed as commonjs.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./node_modules/@storybook/addon-essentials/dist/docs/preset.js.
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
If you believe this is a bug, please open an issue on Github.
Error [ERR_REQUIRE_ESM]: require() of ES Module ./node_modules/rehype-slug/index.js from ./node_modules/@storybook/addon-docs/dist/preset.js not supported.
Instead change the require of index.js in ./node_modules/@storybook/addon-docs/dist/preset.js to a dynamic import() which is available in all CommonJS modules.
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at Object.newLoader [as .js] (./node_modules/pirates/lib/index.js:121:7)
at Module.require (./node_modules/nx/src/adapter/compat.js:66:40)
at Object.<anonymous> (./node_modules/@storybook/addon-docs/dist/preset.js:47:8982)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at newLoader (./node_modules/pirates/lib/index.js:121:7)
at Object.newLoader [as .js] (./node_modules/pirates/lib/index.js:121:7)
at Module.require (./node_modules/nx/src/adapter/compat.js:66:40)
at Object.<anonymous> (./node_modules/@storybook/addon-essentials/dist/docs/preset.js:4:14)
.....
I've investigated it a bit further for our case, which has the same error and stacktrace, I could resolve the problem if (and only if) I revert @nx/playwright from 19.1.0 to 19.0.7. This would allow me to execute the build-storyblock target again. Storybook and Playwright are in no way related, so it might be a red herring.
Digging a bit further, I only have to revert the @nx/playwright/src/plugins/plugin.js content back to the state of v19.0.7, which might illustrate that it has todo with this change:
@edbzn can you confirm my findings?
@meDavidNS Edouard and me are running @nx/playwright v19.0.0. I tried to bump it to 19.0.7 but that didn't make any difference. An interesting fact about this issue is that it only happens in the CI, locally it works fine. Could you provide your Nx and storybook dependencies versions, just to compare?
This issue has been automatically marked as stale because more information has not been provided within 7 days. It will be closed in 21 days if no information is provided. If information has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
@edbzn @svoren258 can you confirm this is is still happening in the latest Nx version?
This issue has been automatically marked as stale because more information has not been provided within 7 days. It will be closed in 21 days if no information is provided. If information has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
Current Behavior
Running
nx run my-package:build-storybook
withnx
v18.2.3 works, but when I upgrade thenx
package to v18.3.0 (and higher), a new Storybook error appears:It's interesting to note that it's related to the
nx
package upgrade, not@nx/storybook
.Expected Behavior
The
@storybook/angular:build-storybook
executor works withnx
>= 18.3.0 and properly loads the Storybook config.GitHub Repo
No response
Steps to Reproduce
I tried to isolate / replicate the issue but I was not able to do so.
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response