Closed jlowcs closed 4 months ago
To resolve the issue, import PromiseWithResolvers
at the top of portable-stories.ts
. Add the following line:
import { PromiseWithResolvers } from '@storybook/core/types';
This should be placed alongside other imports from @storybook/core/types
.
/code/core/src/preview-api/modules/store/csf/portable-stories.ts /code/core/src/preview-api/modules/store/csf
Having the same issue with 8.2.1 during a regular build for our angular library (ng run my-project:storybook) TS2304: Cannot find name 'PromiseWithResolvers'.
Node version: v20.15.0 TypeScript 5.4.5
Hello I have the same issue on my side with the 8.2.1...
node_modules/@storybook/core/dist/preview-api/index.d.ts:349:22 - error TS2304: Cannot find name 'PromiseWithResolvers'.
349 renderingEnded?: PromiseWithResolvers<void>;
~~~~~~~~~~~~~~~~~~~~
=> Failed to build the preview
SB_BUILDER-WEBPACK5_0003 (WebpackCompilationError): There were problems when compiling your code with Webpack.
Run Storybook with --debug-webpack for more information.
"devDependencies": { "@angular-devkit/architect": "^0.1700.0", "@angular-devkit/build-angular": "^17.0.0", "@angular-eslint/builder": "17.5.2", "@angular-eslint/eslint-plugin": "17.5.2", "@angular-eslint/eslint-plugin-template": "17.5.2", "@angular-eslint/schematics": "17.5.2", "@angular-eslint/template-parser": "17.5.2", "@angular/cli": "^17.0.0", "@angular/compiler-cli": "^17.0.0", "@chromatic-com/storybook": "^1.6.1", "@compodoc/compodoc": "^1.1.25", "@eslint/js": "^9.4.0", "@etchteam/storybook-addon-status": "^5.0.0", "@kemuridama/storybook-addon-github": "^1.3.0", "@storybook/addon-a11y": "8.2.1", "@storybook/addon-console": "^3.0.0", "@storybook/addon-designs": "^8.0.3", "@storybook/addon-docs": "8.2.1", "@storybook/addon-essentials": "8.2.1", "@storybook/addon-interactions": "8.2.1", "@storybook/addon-links": "8.2.1", "@storybook/addon-storysource": "8.2.1", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", "@storybook/angular": "8.2.1", "@storybook/blocks": "8.2.1", "@storybook/test": "8.2.1", "@storybook/test-runner": "^0.19.0", "@types/cheerio": "^0.22.31", "@types/jasmine": "~4.3.0", "@types/jasminewd2": "^2.0.10", "@types/jest": "^29.5.1", "@types/lodash": "^4.14.194", "@types/node": "^20.2.3", "@typescript-eslint/eslint-plugin": "7.11.0", "@typescript-eslint/parser": "7.11.0", "@whitespace/storybook-addon-html": "^6.1.1", "cheerio": "^1.0.0-rc.12", "chromatic": "^11.5.4", "eslint": "^9.4.0", "eslint-plugin-import": "2.29.1", "eslint-plugin-jsdoc": "~48.2.9", "eslint-plugin-prefer-arrow": "1.2.3", "eslint-plugin-storybook": "^0.9.0--canary.0", "gh-pages": "^6.1.1", "globals": "^15.4.0", "husky": "^8.0.0", "jasmine-core": "~4.5.0", "jasmine-spec-reporter": "~7.0.0", "json-server": "^0.17.3", "karma": "~6.4.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage": "~2.2.0", "karma-coverage-istanbul-reporter": "^3.0.0", "karma-jasmine": "~5.1.0", "karma-jasmine-html-reporter": "~2.0.0", "msw": "^2.3.1", "msw-storybook-addon": "^2.0.2", "ngx-build-plus": "^14.0.0", "prettier": "^3.3.2", "react-syntax-highlighter": "^15.5.0", "storybook": "8.2.1", "ts-node": "^10.9.1", "tslib": "^2.5.2", "typescript": "~5.4.5", "typescript-eslint": "^7.13.0", "webpack": "5.92.0",
Even if I come back to the 8.1.11 Story book version, it is still the v8.2.x @storybook/preview-api version wich is installed by NPM ... and in my node module, there is no dist folder regarding this version. To have a functionnal 8.1.11 version I have to install manually the preview-api like this : npm i @storybook/preview-api@8.1.11
@kasperpeulen is working on a fix. We will try to release a hotfix soon!
@kasperpeulen is working on a fix. We will try to release a hotfix soon!
Great ! thank you in advance !
Adding "ESNext"
to "lib"
in tsconfig.json
works but I'm not sure that's feasible for everyone.
Describe the bug
A reference to
PromiseWithResolvers
was introduced by https://github.com/storybookjs/storybook/pull/28383That type is not imported anywhere in that file and my library (using react) doesn't compile because of it.
Reproduction link
N/A
Reproduction steps
No response
System
Additional context
No response