storybook: [Bug]: `@storybook/theming/create` export no longer exists with 8.2.2
Describe the bug
I’m upgrading our Storybook from 8.1 to 8.2.2 and ran into the error below:
1:17:48 PM [vite] Internal server error: Failed to resolve import "@storybook/theming/create" from ".storybook/sl-theme.ts". Does the file exist?
Code in question: import { create } from '@storybook/theming/create';
Afaict this code should still be valid (https://storybook.js.org/docs/configure/user-interface/theming#create-a-theme-quickstart)
If i inspect the theming package in my node_modules folder, i don’t see anything anymore that relates to create.
Reproduction link
Reproduction steps
No response
System
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Max
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.1 - /opt/homebrew/bin/node
Yarn: 4.3.1 - /opt/homebrew/bin/yarn <----- active
npm: 10.7.0 - /opt/homebrew/bin/npm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.5
npmPackages:
@storybook/addon-a11y: ^8.2.2 => 8.2.2
@storybook/addon-essentials: ^8.2.2 => 8.2.2
@storybook/addon-storysource: ^8.2.2 => 8.2.2
@storybook/core-events: ^8.2.2 => 8.2.2
@storybook/manager-api: ^8.2.2 => 8.2.2
@storybook/preview-api: ^8.2.2 => 8.2.2
@storybook/test: ^8.2.2 => 8.2.2
@storybook/theming: ^8.2.2 => 8.2.2
@storybook/web-components-vite: ^8.2.2 => 8.2.2
chromatic: ^11.5.5 => 11.5.5
storybook: ^8.2.2 => 8.2.2
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 26 (17 by maintainers)
I think there’s something slightly different going on with PNPM workspaces as well.
Getting the same
create not exportederror, but I have@storybook/theminginstalled in this package.FYI, we are looking into writing an automigration to look for these packages that are referenced in code but not available in
package.jsonand add those dev dependencies automatically. Hopefully this will save a lot of pain for all the users who have yet to upgrade to 8.2.The bot’s statement is false. I’ll investigate.
Hi @vanessayuenn, I checked and the issue has been fixed (at least for me). Thank you very much.
I can’t seem to be able to import
ThemeVarsfrom@storybook/theming/createbut I can from@storybook/core/themingor@storybook/theming.The error actually goes away when I import the
createfunction from@storybook/core/themingor@storybook/theminginstead of@storybook/theming/create.