-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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]: 7.0.18 and newer broke custom non-prop args with Vue3 and Typescript #23352
Comments
I am also seeing a similar issue when using Angular when trying to add an additional custom control. The error:
Story with custom control
Environment info:
|
+1 |
Pinging @kasperpeulen here because the mentioned PRs are from you. Maybe you have an idea of what's going on. |
@kasperpeulen @chakAs3 any idea what's going on here? |
hi @vanessayuenn this is an old issue i don't what is wrong or if it is on the new releases. need a repro to look at it |
In my main post is a repro sandbox |
@johanvanhelden ok i will check it out and get back to you if i have some question |
@K3TH3R Could you provide a reproduction with https://storybook.new/ We actually have a test for this scenario: storybook/code/renderers/vue3/src/public-types.test.ts Lines 38 to 58 in 021c101
|
@kasperpeulen @chakAs3 @vanessayuenn I can confirm it is still broken in Storybook 8.0. Here is a fresh new reproduction environment with Storybook 8.0: If you want to see it working, here is a reproduction environment running Storybook 7.0.17 where it worked: |
@johanvanhelden This is probably related to this PR: Which rolled back an unexpected breaking change in 7.0. The correct way to write this in 7 and 8 is: const meta = {
component: Component,
render: (args) => ({
components: { Component },
data: () => ({ args }),
template: `
<Component v-bind="args">
Card content
<template #footer v-if="args.withFooter">
Footer for the card
</template>
</Component>
`,
}),
args: {
withFooter: false,
},
}; |
Hi there! Thank you for opening this issue, but it has been marked as |
Thank you! I've tried this method and it works flawlessly. |
This is a work-in-progress commit. It all started with simply wanting to build our typedoc generated documentation for modules such as chain-api, chaincode, etc. The short summary is that chain-ui is a UI package, designed to contain multiple front-end libraries/packages. It looks like web component and vue versions to start. And the rest of the mono-repo is GalaChain / Hyperledger Fabric based modules that use Node 18 vs 20, and are fully backend. I may or may not return to this in the future. But I'm publishing this just in case it's useful to anyone else who embarks on this build. Maybe a developer that was involved in the initial chain-ui build. Or maybe we will collectively decide to rework our monorepo structure and separate concerns between UI and backend / blockchain / Hyperledger Fabric libraries. These notes are for my future self or others. I was fully unfamiliar with Vue, Vite, tailwind, etc. etc. and the original development context of this entire chain-ui segment of our monorepo prior to attempting to get all this to build together. And I haven't done any front end work since sometime prior to November 1, 2021. It feels like I made it almost all the way through troubleshooting the monorepo build of galachain/sdk, post-chain-ui merge. However, solving each hurdle seemed to lead to another and eventually I had to move on to other engagements. Rough notes follow Some errors in progress of working through: $ npm run typedoc-chain-api ``` > @gala-chain/sdk@1.4.2 typedoc-chain-api > typedoc --tsconfig ./tsconfig.base.json --hideGenerator --plugin typedoc-plugin-markdown --githubPages false --out ./docs/chain-api-docs ./chain-api/src && rm ./docs/chain-api-docs/README.md [info] Loaded plugin typedoc-plugin-markdown chain-ui/src/components/MintToken.stories.ts:18:23 - error TS2307: Cannot find module './MintToken.vue' or its corresponding type declarations. 18 import MintToken from './MintToken.vue' ~~~~~~~~~~~~~~~~~ chain-ui/src/components/MintTokenWithAllowance.stories.ts:18:36 - error TS2307: Cannot find module './MintTokenWithAllowance.vue' or its corresponding type declarations. 18 import MintTokenWithAllowance from './MintTokenWithAllowance.vue' ``` Many, many more errors like the above follow - lots of TypeScript compilation problems. Possibly in part due to the root of the mono-repo using a different tsconfig than the genesis of this chain-ui package, I'll warrant. ``` Rollup failed to resolve import "primevue/inputText" If you do want to externalize this module explicitly add it to`build.rollupOptions.external` ``` ``` npm i --install-strategy=nested tailwindcss-primeui ``` This link looks similar to what we have - https://storybook.js.org/docs/writing-stories/typescript ``` type Story = StoryObj<typeof Button>; ``` storybookjs/storybook#23352 It appears maybe 7.0.18 broke non-prop custom args Vue3 + TypeScript storybookjs/storybook#22229 And maybe this rolled back some breaking changes seems we're using CSF 2, version 3 migration guide is available and is also discussed in improved ts features blog post https://storybook.js.org/docs/api/csf?ref=storybookblog.ghost.io#upgrading-from-csf-2-to-csf-3 https://storybook.js.org/blog/storybook-csf3-is-here/?ref=storybookblog.ghost.io https://storybook.js.org/blog/improved-type-safety-in-storybook-7/ ``` executed in chain-ui folder $ npm install --install-strategy=nested primevue ``` ``` $ grep primevue package-lock.json "primevue": "^3.53.0", "chain-ui/node_modules/primevue": { "resolved": "https://registry.npmjs.org/primevue/-/primevue-3.53.0.tgz", ``` ran in root dir, doesn't solve ``` npm install -w chain-ui --install-strategy=nested primevue cd chain-ui npm install --install-strategy=nested primevue ``` troubleshooting ``` delete primevue from chain-ui/package.json cd .. npm install cd chain-ui npm install --save --install-strategy=nested primevue ``` https://docs.npmjs.com/cli/v10/using-npm/workspaces https://docs.npmjs.com/cli/v10/using-npm/workspaces#defining-workspaces https://docs.npmjs.com/downloading-and-installing-packages-locally https://docs.npmjs.com/cli/v10/commands/npm-install#install-strategy https://docs.npmjs.com/cli/v10/commands/npm-install#configuration https://docs.npmjs.com/cli/v10/configuring-npm/npmrc https://docs.npmjs.com/cli/v10/configuring-npm/package-json?v=true#bundledependencies https://nx.dev/concepts/decisions/why-monorepos https://nx.dev/nx-api/storybook https://nx.dev/nx-api/storybook https://nodejs.org/api/packages.html#conditional-exports https://v3.primevue.org/theming/ https://v3.primevue.org/vite https://stackoverflow.com/questions/61467722/difference-between-npm-update-and-remove-package-lock-json-plus-npm-install https://stackoverflow.com/questions/77755121/vue-tsc-failing-with-error-referenced-project-may-not-disable-emit-on-vue-proj https://stackoverflow.com/questions/76935759/how-to-get-vite-ts-and-vue-to-properly-work-in-vs-code https://www.geeksforgeeks.org/how-to-override-nested-npm-dependency-versions/ https://blog.logrocket.com/comparing-vue-3-options-api-composition-api/ https://stackoverflow.com/questions/71055016/vue-3-defineprops-with-types-and-componentobjectpropsoptions-like-default-or-va https://stackoverflow.com/questions/66288645/vite-does-not-build-tailwind-based-on-config https://vitejs.dev/guide/features.html#postcss https://stackoverflow.com/questions/66288645/vite-does-not-build-tailwind-based-on-config/78451703#78451703 https://tailwindcss.com/docs/content-configuration https://vitejs.dev/config/build-options#build-target https://rollupjs.org/configuration-options/ https://rollupjs.org/configuration-options/#output-hoisttransitiveimports https://rollupjs.org/configuration-options/#context https://nx.dev/recipes/vite/configure-vite https://nx.dev/nx-api/vite https://nx.dev/nx-api/vite/generators/configuration https://stackoverflow.com/questions/70807080/how-to-change-the-ts-path-aliases-for-an-nx-application https://tailwindcss.com/docs/guides/vite#vue https://v2.tailwindcss.com/docs/guides/vue-3-vite https://tailwindcss.com/docs/customizing-colors https://primevue.org/tailwind/ Omitted various links to github issues in related dependencies
Describe the bug
In Storybook 7.0.17 and below I had the following list of
args
:Where
withError
,withHelpText
andvalue
are custom controls. They are not props on the component in the story but used to make some reactive functionality work in the story itself. This worked great.After updating to 7.0.18 or newer (tried the latest v8.0.5) they stopped working and the story completely broke.
I assume it's either because of this: #22814 or this #22717 but that's just a guess.
I get the following typescript error:
To Reproduce
Here is a fresh new reproduction environment with Storybook 8.0:
https://stackblitz.com/edit/github-vrknd1-cwcnes?file=package.json
See that the story is now broken and the
withFooter
is not functional and the footer is also not visible.If you want to see it working, here is a reproduction environment running Storybook 7.0.17 where it worked:
https://stackblitz.com/edit/github-vrknd1-jpfa6f?file=package.json
The repro files can also be found here: https://gist.github.com/johanvanhelden/59abcf104c03d07e08d34eb11fd51511
System
Additional context
No response
The text was updated successfully, but these errors were encountered: