[Bug]: TypeError: Cannot read properties of undefined (reading 'startsWith') #25503
-
Describe the bugnextjs+eslint+prettier: To ReproduceNo response SystemEnvironment Info:
System:
OS: Windows 10 10.0.22631
CPU: (16) x64 Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz
Binaries:
Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.6.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 114.0.5735.199
Edge: Spartan (44.22621.2048.0), Chromium (114.0.1823.79)
npmPackages:
@storybook/addon-essentials: ^7.0.27 => 7.0.27
@storybook/addon-interactions: ^7.0.27 => 7.0.27
@storybook/addon-links: ^7.0.27 => 7.0.27
@storybook/blocks: ^7.0.27 => 7.0.27
@storybook/nextjs: ^7.0.27 => 7.0.27
@storybook/react: ^7.0.27 => 7.0.27
@storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2 Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
I managed to solve my problem with this same error which I posted about on Storybook Discord at: https://discord.com/channels/486522875931656193/1130448886016770098 I had Prettier version 3.0.0 in my I had other issues with prettier plugins recently and I'm informed Prettier version 3.0.0 introduces breaking changes for plugins. I was using |
Beta Was this translation helpful? Give feedback.
-
Indeed, I used prettier v3.0.0 and added prettier-plugin-tailwindcss. now I removed prettier-plugin-tailwindcss and everything is back to normal, thanks! |
Beta Was this translation helpful? Give feedback.
-
@Star-tears Do you still have any open questions or can we close this issue? |
Beta Was this translation helpful? Give feedback.
-
I'd say so as it seems to be specifically an issue with having
|
Beta Was this translation helpful? Give feedback.
-
Also having a similar error with version 3.0.0 when I run prettier using its cli |
Beta Was this translation helpful? Give feedback.
-
version 2.8.8 works fine |
Beta Was this translation helpful? Give feedback.
-
Same issue for me. As per @Seefer it was due to |
Beta Was this translation helpful? Give feedback.
-
What package manager do you use? I'm seeing this running Pnpm and wondering if package manager behavior complications could be a contributing factor. I'm somewhat of a web dev noob so this is me spitballing. |
Beta Was this translation helpful? Give feedback.
-
I am using NPM so the issue is not specific to pnpm. While I can't comment on yarn, it seems to me like the tailwind package just needs an update. |
Beta Was this translation helpful? Give feedback.
I managed to solve my problem with this same error which I posted about on Storybook Discord at:
https://discord.com/channels/486522875931656193/1130448886016770098
I had Prettier version 3.0.0 in my
packages.json
and have discovered that if I revert that to version 2.8.8 and then runpnpm dlx sb init
, to relaunch the initialization step, it completes without error and I can then runpnpm storybook
to successfully launch the Storybook server.I had other issues with prettier plugins recently and I'm informed Prettier version 3.0.0 introduces breaking changes for plugins. I was using
prettier-plugin-tailwindcss
before the Tailwind Labs peeps updated it to 0.4.0, which is where I heard of t…