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

Storybook not working for new workspace #14093

Closed
smurfens opened this issue Jan 2, 2023 · 3 comments · Fixed by #14110 or #14111
Closed

Storybook not working for new workspace #14093

smurfens opened this issue Jan 2, 2023 · 3 comments · Fixed by #14110 or #14111
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug

Comments

@smurfens
Copy link

smurfens commented Jan 2, 2023

Current Behavior

Trying to set up a freash monorepo with a react library and storybook. I have tired all kinds of framework libraires with no success and the same error over and over again.

Expected Behavior

Get storybook to start locally

Github Repo

No response

Steps to Reproduce

  1. nx g @nrwl/react:lib my-react2
  2. nx g @nrwl/react:storybook-configuration --name=my-react2
  3. nx storybook my-react2

Nx Report

Node : 18.9.0
   OS   : darwin x64
   npm  : 8.19.1
   
   nx : 15.4.2
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.4.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.4.2
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.4.2
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.4.2
   @nrwl/js : 15.4.2
   @nrwl/linter : 15.4.2
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.4.2
   @nrwl/react-native : Not Found
   @nrwl/rollup : 15.4.2
   @nrwl/schematics : Not Found
   @nrwl/storybook : 15.4.2
   @nrwl/web : 15.4.2
   @nrwl/webpack : 15.4.2
   @nrwl/workspace : 15.4.2
   @nrwl/vite : 15.4.2
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Failure Logs

> nx run my-react2:storybook

info @storybook/react v6.5.15
info 
info => Loading presets
info Addon-docs: using MDX1
=> Loading Nrwl React Storybook preset from "@nrwl/react/plugins/storybook"
info => Using default Webpack5 setup
(node:18856) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
<i> [webpack-dev-middleware] wait until bundle finished

info => Ignoring cached manager due to change in manager config
<i> [webpack-dev-middleware] wait until bundle finished
assets by chunk 6.04 MiB (id hint: vendors)
  assets by status 5.83 MiB [big]
    asset vendors-node_modules_storybook_addon-actions_manager_js-node_modules_storybook_addon-backgrou-45da3d.manager.bundle.js 4.39 MiB [emitted] [big] (id hint: vendors)
    asset vendors-node_modules_storybook_components_dist_esm_formatter-0d5cb0eb_js.manager.bundle.js 888 KiB [emitted] [big] (id hint: vendors)
    asset vendors-node_modules_storybook_components_dist_esm_OverlayScrollbars-1355f44c_js.manager.bundle.js 295 KiB [emitted] [big] (id hint: vendors)
    asset vendors-node_modules_storybook_components_dist_esm_syntaxhighlighter-b07b042a_js.manager.bundle.js 286 KiB [emitted] [big] (id hint: vendors)
  asset vendors-node_modules_storybook_components_dist_esm_WithTooltip-167e9982_js.manager.bundle.js 126 KiB [emitted] (id hint: vendors)
  asset vendors-node_modules_storybook_components_dist_esm_Color-f953d088_js.manager.bundle.js 83.3 KiB [emitted] (id hint: vendors)
  asset vendors-node_modules_storybook_components_dist_esm_GlobalScrollAreaStyles-8793ce4a_js.manager.bundle.js 15.6 KiB [emitted] (id hint: vendors)
asset runtime~main.manager.bundle.js 14.2 KiB [emitted] (name: runtime~main)
asset index.html 4.36 KiB [emitted]
asset main.manager.bundle.js 1.36 KiB [emitted] (name: main)
asset node_modules_unfetch_dist_unfetch_js.manager.bundle.js 1.26 KiB [emitted]
Entrypoint main [big] 4.41 MiB = runtime~main.manager.bundle.js 14.2 KiB vendors-node_modules_storybook_addon-actions_manager_js-node_modules_storybook_addon-backgrou-45da3d.manager.bundle.js 4.39 MiB main.manager.bundle.js 1.36 KiB
orphan modules 973 KiB [orphan] 94 modules
runtime modules 8.69 KiB 15 modules
modules by path ./node_modules/ 5.39 MiB 856 modules
./util.inspect (ignored) 15 bytes [built] [code generated]
manager (webpack 5.75.0) compiled successfully in 8949 ms
webpack built preview 1b3487ec1c8a2ba0610b in 10546ms
WARN Force closed manager build
ModuleBuildError: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at filename (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:94:23)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:122:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:194)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:97
    at processResult (/Users/hampusbilling/Projects/test/node_modules/webpack/lib/NormalModule.js:758:19)
    at /Users/hampusbilling/Projects/test/node_modules/webpack/lib/NormalModule.js:860:5
    at /Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:400:11
    at /Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:252:18
    at context.callback (/Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/index.js:59:103
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at process.processImmediate (node:internal/timers:442:9)
ModuleBuildError: Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at filename (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:94:23)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:122:39
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:3:103)
    at _next (/Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:194)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:364
    at new Promise (<anonymous>)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/cache.js:5:97
    at processResult (/Users/hampusbilling/Projects/test/node_modules/webpack/lib/NormalModule.js:758:19)
    at /Users/hampusbilling/Projects/test/node_modules/webpack/lib/NormalModule.js:860:5
    at /Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:400:11
    at /Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:252:18
    at context.callback (/Users/hampusbilling/Projects/test/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
    at /Users/hampusbilling/Projects/test/node_modules/babel-loader/lib/index.js:59:103
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at process.processImmediate (node:internal/timers:442:9)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

info => Loading presets
webpack built preview 9977dfcc0137e770eff7 in 312ms

 ———————————————————————————————————————————————————————————————————————

 >  NX   Ran target undefined for project my-react2 (19s)
 
    ✖    1/1 failed
    ✔    0/1 succeeded [0 read from cache]

Additional Information

No response

@mandarini mandarini self-assigned this Jan 3, 2023
@mandarini mandarini added the scope: storybook Issues related to Storybook support in Nx label Jan 3, 2023
@mandarini
Copy link
Member

Same: #14055

@mandarini
Copy link
Member

mandarini commented Jan 3, 2023

Can you please try the following versions:

"@storybook/react": "^6.5.15",
"@storybook/builder-vite": "^0.2.6",

and let me know if your issue is fixed?

You also need to add a .babelrc file in that library for it to work. See my PR: #14111

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug
Projects
None yet
2 participants