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

[Bug]: Storybook 7.0.0 to 7.1.0 - TypeScript warnings for @storybook/angular framework #21696

Closed
nstuyvesant opened this issue Mar 20, 2023 · 19 comments

Comments

@nstuyvesant
Copy link

Describe the bug

I am using Storybook 7.0.0-rc.4 with Angular 14.2. In the tsconfig.json for Storybook, I forgot to set compilerOptions.skipLibCheck to false and it reported these warnings...

info => Preview built (30 s)
WARN export 'default' (imported as 'previewAnnotations') was not found in '/Users/xyz/dev/carbon-charts/node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs' (possible exports: highlightObject, highlightStyle)
WARN export 'default' (imported as 'previewAnnotations') was not found in '/Users/xyz/dev/carbon-charts/node_modules/@storybook/angular/dist/client/config.js' (possible exports: __esModule, applyDecorators, parameters, render, renderToCanvas)
WARN export 'default' (imported as 'previewAnnotations') was not found in '/Users/xyz/dev/carbon-charts/node_modules/@storybook/angular/dist/client/docs/config' (possible exports: __esModule, argTypesEnhancers, decorators, parameters)

The build proceeded without problems but I thought I'd report this.

To Reproduce

No response

System

Environment Info:

  System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 18.15.0 - /opt/homebrew/bin/node
    Yarn: 3.5.0 - /opt/homebrew/bin/yarn
    npm: 9.6.2 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 111.0.5563.64
    Firefox: 111.0
    Safari: 16.3
  npmPackages:
    @storybook/angular: ^7.0.0-0 => 7.0.0-rc.4

Additional context

No response

@lacroixdavid1
Copy link

lacroixdavid1 commented May 3, 2023

I'm on 7.0.8 and I'm facing this only when I set config.features.storyStoreV7 to false.

./node_modules/@storybook/addon-essentials/dist/actions/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/actions/preview.mjs' (possible exports: argsEnhancers)
./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs' (possible exports: decorators, globals, parameters)
./node_modules/@storybook/addon-essentials/dist/docs/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/docs/preview.mjs' (possible exports: parameters)
./node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs' (possible exports: highlightObject, highlightStyle)
./node_modules/@storybook/addon-essentials/dist/measure/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/measure/preview.mjs' (possible exports: decorators, globals)
./node_modules/@storybook/addon-essentials/dist/outline/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-essentials/dist/outline/preview.mjs' (possible exports: decorators, globals)
./node_modules/@storybook/addon-interactions/dist/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-interactions/dist/preview.mjs' (possible exports: argsEnhancers, parameters, runStep)
./node_modules/@storybook/addon-links/dist/preview.mjs-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/addon-links/dist/preview.mjs' (possible exports: decorators)
./node_modules/@storybook/angular/dist/client/config.js-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/angular/dist/client/config.js' (possible exports: __esModule, applyDecorators, parameters, render, renderToCanvas)
./node_modules/@storybook/angular/dist/client/docs/config.js-generated-config-entry.js 4:15-41export 'default' (imported as 'previewAnnotations') was not found in '/mnt/data/dev/repos/everflow/frontend-revam
./node_modules/@storybook/angular/dist/client/docs/config.js' (possible exports: __esModule, argTypesEnhancers, decorators, parameters)
undefined undefined
DefinePlugin
Conflicting values for 'process.env.NODE_ENV'

Letting the default true value is worse. Components and stories are randomly breaking when switching from one to another until the page is refreshed.

@bmarsh432
Copy link

I'm using 7.0.11 for web components and I also face the same issue when setting storyStorev7 to false which I'm having to do because of component rendering issues.

./.storybook/preview.js-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//.storybook/preview.js' (possible exports: __namedExportsOrder, parameters)
./node_modules/@storybook/addon-a11y/dist/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-a11y/dist/preview.mjs' (module has no exports)
./node_modules/@storybook/addon-essentials/dist/actions/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/actions/preview.mjs' (possible exports: argsEnhancers)
./node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/backgrounds/preview.mjs' (possible exports: decorators, globals, parameters)
./node_modules/@storybook/addon-essentials/dist/docs/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/docs/preview.mjs' (possible exports: parameters)
./node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/highlight/preview.mjs' (possible exports: highlightObject, highlightStyle)
./node_modules/@storybook/addon-essentials/dist/measure/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/measure/preview.mjs' (possible exports: decorators, globals)
./node_modules/@storybook/addon-essentials/dist/outline/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-essentials/dist/outline/preview.mjs' (possible exports: decorators, globals)
./node_modules/@storybook/addon-interactions/dist/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-interactions/dist/preview.mjs' (possible exports: argsEnhancers, parameters, runStep)
./node_modules/@storybook/addon-links/dist/preview.mjs-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/addon-links/dist/preview.mjs' (possible exports: decorators)
./node_modules/@storybook/web-components/preview.js-generated-config-entry.js 15:15-41
export 'default' (imported as 'previewAnnotations') was not found in 'C:/Users//source/repos//node_modules/@storybook/web-components/preview.js' (possible exports: argTypesEnhancers, decorators, parameters, render, renderToCanvas)

@Marklb
Copy link
Member

Marklb commented May 16, 2023

I am not positive, but this may be related to another issue I have been looking into. #22542

Does anyone have a repro of this issue, to see if it is the same as the one I am debugging and may provide more information on where to look?

My issue only throws at runtime and it is with a non-storybook dependency, but it is also an .mjs error. I found that with the "exports" property in package.json of the imported package, the .mjs file gets imported and throws an error about the default not being found, but if I remove the "exports" property then the .js file gets imported directly and it works fine.

Looking at some of the @storybook/* packages, they are published with the "exports" property in their package.json. I think those packages are correct to be defining the "exports" property, but I don't know why those imports work when building Angular directly and not through Storybook. I am slowly debugging it, by tweaking settings and stepping through parts of the code, but I am hoping someone more familiar with configuring builds knows where to look.

@nstuyvesant
Copy link
Author

Not a minimal repro but easy to reproduce...

git clone https://github.com/nstuyvesant/carbon-charts.git
cd carbon-charts
git checkout pr-1544
git pull
yarn install
yarn build
cd packages/angular
yarn build:demo

Actually the broader yarn build will reproduce it but it has a number of packages to build so too many messages. The last step homes in on it.

@nstuyvesant
Copy link
Author

By the way, our Angular package is 16.0.1.

@tfrijsewijk
Copy link

With Storybook 7.0.22:

image

@itzikd15
Copy link

7.0.27 still has this error as well

@nstuyvesant nstuyvesant changed the title [Bug]: Storybook 7.0.0-rc.4 - TypeScript warnings [Bug]: Storybook 7.0.0 to 7.1.0 - TypeScript warnings Jul 21, 2023
@nstuyvesant nstuyvesant changed the title [Bug]: Storybook 7.0.0 to 7.1.0 - TypeScript warnings [Bug]: Storybook 7.0.0 to 7.1.0 - TypeScript warnings for @storybook/angular framework Jul 21, 2023
@nstuyvesant
Copy link
Author

Still an issue with 7.1.0.

@alexanderistomin-qredo
Copy link

Still the same with 7.3.1

@KarineBrandelli
Copy link

KarineBrandelli commented Oct 18, 2023

Same here but using react + webpack.
The application runs fine but if I change the storyStoreV7 to true it doesn't even builds.

Storybook 7.5.0 and all the addons also the same version.

Can someone tag me if there's a solution?

image

@baileyandy
Copy link

@KarineBrandelli using storyStoreV7 imposes some extra requirements on the stories, so perhaps you can migrate, allowing use of storyStoreV7? This was the only way I could get v7 working with my project, avoiding the TypeScript issues.

@KarineBrandelli
Copy link

@baileyandy that's the thing, my stories are already migrated. It seems a problem in the preview.ts file.

this is when storyStoreV7: true.

image

@quantizor
Copy link

I don't really see the point of this warning, it emits even for first-party dependencies that are fully-updated. Nothing seems to be broken.

Screenshot 2023-12-04 at 12 39 40 PM

@GaroGabrielyan
Copy link

Screenshot 2023-12-22 at 12 25 25 PM

@reabiliti
Copy link

Screenshot 2023-12-22 at 12 25 25 PM

you can try export type

@valentinpalkovic
Copy link
Contributor

I can't reproduce it in the latest version of Storybook v8. Can someone provide a reproduction with the latest version of Storybook? https://storybook.new

Copy link
Contributor

github-actions bot commented Jun 1, 2024

Hi there! Thank you for opening this issue, but it has been marked as stale because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!

@github-actions github-actions bot added the Stale label Jun 1, 2024
@nstuyvesant
Copy link
Author

We went a different direction and no longer use Storybook. Perhaps someone else can provide a repro.

Copy link
Contributor

github-actions bot commented Jul 2, 2024

I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests