-
-
Notifications
You must be signed in to change notification settings - Fork 9.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
Issue while using storybookjs Knobs Addon @5.3.19 in Angular 7 Workspace #11391
Comments
FYI, we’ve released addon-controls in 6.0-beta. Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term. Please upgrade and try them out today! |
Hi Shilman, I tried the control addon and did not find Issues while integrating it. However, I am unable to use the addon as it is throwing error. Do you have any reference guide for how to use control for angular? I found the storybook doc very hard to follow for Angular as most of the examples are for React. Is there a better approach I could take to follow the doc? As today I spent around 8 hours :( Following are my configuration files: Storybook Versions: "@storybook/addon-actions": "^5.3.19", main.js module.exports = { preview.js import { addParameters } from '@storybook/angular'; import docJson from '../documentation.json'; //https://github.com/storybookjs/storybook/tree/next/addons/docs/angular setCompodocJson(docJson); addParameters({ docs: { iframeHeight: 600 } }); addParameters({ addParameters({ export const parameters = { 0-Welcome.stories.tsx export default { export const ToStorybook = (args) => ({ ToStorybook.story = { 1-Button.stories.mdx import { Meta, Story, Props } from '@storybook/addon-docs/blocks'; <Meta title='Button' decorators={[ Basic Checkbox{{ Error: (Complete Console.log) vendors~main.6a694b58746d7f5188c6.bundle.js:166772 Warning: Each child in a list should have a unique "key" prop. Check the top-level render call using <Styled(div)>. See https://fb.me/react-warning-keys for more information. printWarning @ vendors~main.6a694b58746d7f5188c6.bundle.js:166772 vendors vendors~main.6a694b58746d7f5188c6.bundle.js:141999 The above error occurred in the component: React will try to recreate this component tree from scratch using the error boundary you provided, LocationProvider. logCapturedError @ vendors~main.6a694b58746d7f5188c6.bundle.js:141999 vendors vendors~main.6a694b58746d7f5188c6.bundle.js:141999 The above error occurred in the component: Consider adding an error boundary to your tree to customize error handling behavior. Visit https://fb.me/react-error-boundaries to learn more about error boundaries. logCapturedError @ vendors |
@akhilesh85 Try
|
Hi Shilman, Thanks. I managed to upgrade to beta-44. When I upgraded it gave some errors. I have some .scss files in my workspace hence I had to install sass-loader css-loader and style-loader of webpack as part of preset-scss storybook presets. On running the storybook, I got the below error: [0] multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-links/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/preset/addArgs.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js ./node_modules/webpack-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined src/styles/app.scss 136 bytes {main} [built] [src/styles/app.scss] src/styles/app.scss 2.31 KiB {main} [built] ERROR in src/styles/app.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/dist/cjs.js??ref--9-3!src/styles/app.scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js ERROR in ./.storybook/preview.js-generated-config-entry.js Options in the validate.js (Validate Function) of Sass Loader. I outputed some logs from the function 2% building 21/26 modules 5 active node_modules/@storybook/client-logger/dist/index.jsschema => { type: 'object', Options => { ] configuration => { name: 'Sass Loader', baseDataPath: 'options' } |
I was able to resolve the above error in my angular 7 workspace. I had to upgrade core-js from 2.6.11 to 3.6.5 and downgrade sass-loader from 8.0.2 to 7.3.1. In addition to this, I had to add some path entries in my tsconfig.json. zloirock/core-js#573 (comment) |
I managed to get this working without using the beta release and without downgrading sass-loader, and only upgrading core-js (3.6.5) |
Hi, the reason for sass-loader downgrade was that my project was throwing errors with regard to scss declartions, as it was only compatible with the lower version of sass. |
Describe the bug
When I installed story book in my angular 7 workspace with typescript@3.2.4, all the pre-installed addons such as actions and links were working fine without an errors. The moment I installed Knobs addon it started throwing errors.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
As the latest storybook does not have a dependency on typescript version, the knob addon should also not have any dependency on the Typescript version. Addon should always align to all the storybook supported versions and not define its explicit dependencies. Because of this issue, even though storybook.js is fully compatible with Angular 7 workspace, because of the Knobs addon explicit dependency on TS, the latest version of storybook.js cannot be used. I even tried adding all other latest addons of story book, all the addons worked fine in Angular 7 workspace except Knob addons.
Constrain*
I cannot upgrade my workspace to 8 as there are a lot of dependent components that I have to rework for the upgrade.
Error Details
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Array.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Array.d.ts(3,53):
TS2304: Cannot find name 'readonly'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Array.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Array.d.ts(3,62):
TS2693: 'string' only refers to a type, but is being used as a value here.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts(4,134):
TS2304: Cannot find name 'readonly'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts(4,143):
TS2365: Operator '>' cannot be applied to types 'boolean' and 'undefined[]'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts(4,143):
TS2693: 'NonNullable' only refers to a type, but is being used as a value here.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Options.d.ts(4,155):
TS2304: Cannot find name 'T'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts(4,197):
TS2304: Cannot find name 'readonly'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts(4,206):
TS2693: 'Extract' only refers to a type, but is being used as a value here.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts(4,206):
TS2695: Left side of comma operator is unused and has no side effects.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts(4,214):
TS2304: Cannot find name 'T'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/components/types/Select.d.ts(4,217):
TS2693: 'PropertyKey' only refers to a type, but is being used as a value here.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts(3,44):
TS2304: Cannot find name 'readonly'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts(3,67):
TS2304: Cannot find name 'U'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts(3,73):
TS2304: Cannot find name 'T'.
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts
ERROR in node_modules/@storybook/addon-knobs/ts3.5/dist/type-defs.d.ts(3,75):
TS2304: Cannot find name 'P'.
The text was updated successfully, but these errors were encountered: