nx g @nx/angular:library --name=test --directory=libs/test --projectNameAndRootFormat=as-provided --no-interactive : create an angular library
nx g @nx/angular:storybook-configuration --project=test --no-interactive: generate storybook configuration for test library
npx storybook@latest upgrade --config-dir ./libs/test/.storybook: upgrade storybook to version 8 with the storybook schematics then follow each steps
nx add @storybook/plugin : add storybook plugin
nx g @nx/plugin:plugin --name=test-plugin --directory=plugin/test-plugin --projectNameAndRootFormat=as-provided --no-interactive : create a plugin
nx g @nx/plugin:executor --name=storybook --directory=/plugin/test-plugin/src/executors --nameAndDirectoryFormat=as-provided --no-interactive : create an executor for the plugin
update project.json of test lib to add the executor
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./libs/test/.storybook/main.ts.
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.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./node_modules/@storybook/addon-essentials/dist/index.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.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @storybook/addon-essentials/docs.
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.
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 Object.newLoader [as .js] (./node_modules/pirates/lib/index.js:121:7)
at Module.require (./node_modules/nx/src/adapter/compat.js:65:40)
at Object.<anonymous> (./node_modules/@storybook/addon-docs/dist/preset.js:47:8978)
at loadPreset (./node_modules/@storybook/core-common/dist/index.js:12:59)
at loadPreset (./node_modules/@storybook/core-common/dist/index.js:12:59)
at async Promise.all (index 0)
at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at async loadPreset (./node_modules/@storybook/core-common/dist/index.js:10:1291)
at async Promise.all (index 0)
at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at async loadPreset (./node_modules/@storybook/core-common/dist/index.js:10:1291)
at async Promise.all (index 1)
at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at async getPresets (./node_modules/@storybook/core-common/dist/index.js:12:1503)
at loadPreset (./node_modules/@storybook/core-common/dist/index.js:12:59)
at async Promise.all (index 0)
at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at async loadPreset (./node_modules/@storybook/core-common/dist/index.js:10:1291)
at async Promise.all (index 1)
at async loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at async getPresets (./node_modules/@storybook/core-common/dist/index.js:12:1503)
at async buildDevStandalone (./node_modules/@storybook/core-server/dist/index.js:65:2020)
at async withTelemetry (./node_modules/@storybook/core-server/dist/index.js:28:3579)
at loadPreset (./node_modules/@storybook/core-common/dist/index.js:12:59)
at async Promise.all (index 1)
at loadPresets (./node_modules/@storybook/core-common/dist/index.js:12:483)
at getPresets (./node_modules/@storybook/core-common/dist/index.js:12:1503)
at buildDevStandalone (./node_modules/@storybook/core-server/dist/index.js:65:2020)
at withTelemetry (./node_modules/@storybook/core-server/dist/index.js:28:3579)
WARN Failed to load preset: {"name":"/Users/thomaslaforge/Documents/Project/rosa/org/node_modules/@storybook/addon-essentials/dist/docs/preset.js"} on level 3
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 Object.newLoader [as .js] (./node_modules/pirates/lib/index.js:121:7)
at Module.require (./node_modules/nx/src/adapter/compat.js:65:40)
at Object.<anonymous> (./node_modules/@storybook/addon-docs/dist/preset.js:47:8978)
Current Behavior
Running the following custom executors fails when using Storybook 8
However when running @storybook/angular:start-storybook directly, everything works as expected
Expected Behavior
We want to launch storybook.
GitHub Repo
https://github.com/tomalaforge/nx-storybook-8-executor
Steps to Reproduce
npx create-nx-workspace@latest
: create nx workspacenx add @storybook/angular
: add storybooknx g @nx/angular:library --name=test --directory=libs/test --projectNameAndRootFormat=as-provided --no-interactive
: create an angular librarynx g @nx/angular:storybook-configuration --project=test --no-interactive
: generate storybook configuration for test librarynpx storybook@latest upgrade --config-dir ./libs/test/.storybook
: upgrade storybook to version 8 with the storybook schematics then follow each stepsnx add @storybook/plugin
: add storybook pluginnx g @nx/plugin:plugin --name=test-plugin --directory=plugin/test-plugin --projectNameAndRootFormat=as-provided --no-interactive
: create a pluginnx g @nx/plugin:executor --name=storybook --directory=/plugin/test-plugin/src/executors --nameAndDirectoryFormat=as-provided --no-interactive
: create an executor for the pluginNx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response