storybookjs / addon-styling-webpack

Successor to @storybook/addon-styling. Configure the styles of your webpack storybook with ease!
MIT License
28 stars 2 forks source link

[Bug] Using node-logger v8.5.0 causes logging to fail #24

Closed botonddombi closed 3 weeks ago

botonddombi commented 3 weeks ago

Describe the bug

When using node-logger v8.5.0 the logging fails due to the unsupported bold fn. This is because the node-logger's exported colors fn was replaced with a custom function instead of the chalk package. See: https://github.com/storybookjs/storybook/commit/6e1dbe47b75732319d66c3e0c2789511a624633b

Steps to reproduce the behavior

Install the latest storybook or upgrade. The version of node-logger must be v8.5.0-alpha.1

  1. Add "@storybook/addon-styling-webpack" to StorybookConfig
  2. Run npm storybook
  3. Have at least one addon with styling

Expected behavior

No errors should happen during the storybook preview build and the style logs should be printed.

Screenshots and/or logs

npm run storybook                              

> cms@0.1.0 storybook
> storybook dev -p 6006

@storybook/core v8.4.0

info => Serving static files from ././public at /
info => Starting manager..
WARN No story files found for the specified pattern: src/**/*.mdx
info => Starting preview..
info Addon-docs: using MDX3
info => Using implicit CSS loaders
info => Using SWC as compiler
=> Failed to build the preview
TypeError: nodeLogger.colors.pink.bold is not a function
    at webpackFinal (./node_modules/@storybook/addon-styling-webpack/src/preset.ts:3:29)
    at ./node_modules/@storybook/core/dist/common/index.cjs:16512:18
    at async Object.webpack (./node_modules/@storybook/builder-webpack5/dist/presets/custom-webpack-preset.js:1:3280)
    at async starter (./node_modules/@storybook/builder-webpack5/dist/index.js:1:22057)
    at async Module.start (./node_modules/@storybook/builder-webpack5/dist/index.js:1:25862)
    at async storybookDevServer (./node_modules/@storybook/core/dist/core-server/index.cjs:36000:11)
    at async buildOrThrow (./node_modules/@storybook/core/dist/core-server/index.cjs:35017:12)
    at async buildDevStandalone (./node_modules/@storybook/core/dist/core-server/index.cjs:37190:78)
    at async withTelemetry (./node_modules/@storybook/core/dist/core-server/index.cjs:35757:12)
    at async dev (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3)
nspector commented 3 weeks ago

This is caused by 8.4.0 as well