You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v0.7.3 throws "TypeError: e.charAt is not a function" / "a.startsWith is not a function" for most files via CLI (regression from v0.7.2) #456
What version of prettier-plugin-tailwindcss are you using?
v0.7.3 (works correctly on v0.7.2 with the same setup)
What version of Tailwind CSS are you using?
v4.1.18
What version of Node.js are you using?
v24.11.1
What package manager are you using?
pnpm v10.33.0
What operating system are you using?
macOS (Darwin 25.3.0)
Reproduction URL
(Will add a minimal repro repo on request — happy to provide if needed)
Describe your issue
After upgrading prettier-plugin-tailwindcss from 0.7.2 → 0.7.3, running Prettier via the CLI (prettier --check .) fails for almost every file in the project with one of the following errors:
TypeError: e.charAt is not a function — for files routed through the TypeScript parser (.ts, .tsx, next.config.ts, etc.)
TypeError: a.startsWith is not a function — for files routed through the Babel parser (.mjs such as eslint.config.mjs, postcss.config.mjs)
Pinning back to 0.7.2 resolves the issue completely. No other changes were made.
Stack trace (representative)
[error] next.config.ts: TypeError: e.charAt is not a function
[error] at X4 (.../prettier@3.6.2/.../prettier/plugins/typescript.mjs:20:586)
[error] at Object.e3 [as parse] (.../prettier@3.6.2/.../prettier/plugins/typescript.mjs:20:1508)
[error] at parser.parse (.../prettier-plugin-tailwindcss@0.7.3/.../prettier-plugin-tailwindcss/dist/index.mjs:303:41)
[error] at async parse5 (.../prettier@3.6.2/.../prettier/index.mjs:16731:11)
[error] at async coreFormat (.../prettier@3.6.2/.../prettier/index.mjs:17287:25)
[error] postcss.config.mjs: TypeError: a.startsWith is not a function
[error] at Xr (.../prettier@3.6.2/.../prettier/plugins/babel.mjs:12:444)
[error] at Ca (.../prettier@3.6.2/.../prettier/plugins/babel.mjs:15:2211)
[error] at Object.parse (.../prettier@3.6.2/.../prettier/plugins/babel.mjs:15:2570)
[error] at parser.parse (.../prettier-plugin-tailwindcss@0.7.3/.../prettier-plugin-tailwindcss/dist/index.mjs:303:41)
The trace consistently passes through dist/index.mjs:303, which corresponds to:
Notably, the wrapped call passes options as a third argument to the underlying parser. In Prettier 3 the parser API is parse(text, options); the extra positional argument may be confusing downstream typing in some plugin/parser combinations, though I have not confirmed this is the exact cause.
With prettier-plugin-tailwindcss@0.7.3 (and prettier 3.6.2, tailwindcss 4.1.18), prettier --check . throws three distinct TypeErrors depending on which parser is used:
File
Parser
Error
next.config.ts
typescript
TypeError: e.charAt is not a function
eslint.config.mjs
babel
TypeError: a.startsWith is not a function
postcss.config.mjs
babel
TypeError: a.startsWith is not a function
src/app/globals.css
postcss
TypeError: t.slice is not a function
The PostCSS parser case (globals.css) was not in my original report — I noticed it while building this minimal repro, so the regression appears to affect a fourth parser as well.
Pinning back to 0.7.2 makes all four errors disappear (only formatting warnings remain). All traces pass through prettier-plugin-tailwindcss/dist/index.mjs:303 (the wrapped parser.parse).
Let me know if there's anything else that would be helpful.
Activity
RobinMalfait commentedon Apr 26, 2026
Hey! Please provide a minimal reproduction so we can take a look.
chore: prettier-plugin-tailwindcss v0.7.3 リグレッションの最小再現を追加
inouetakuya commentedon Apr 27, 2026
Hi @RobinMalfait, thanks for the quick response! I've put together a minimal reproduction:
https://github.com/inouetakuya/prettier-plugin-tailwindcss-v0.7.3-repro
Reproduction steps
What it shows
With
prettier-plugin-tailwindcss@0.7.3(and prettier3.6.2, tailwindcss4.1.18),prettier --check .throws three distinctTypeErrors depending on which parser is used:next.config.tsTypeError: e.charAt is not a functioneslint.config.mjsTypeError: a.startsWith is not a functionpostcss.config.mjsTypeError: a.startsWith is not a functionsrc/app/globals.cssTypeError: t.slice is not a functionThe PostCSS parser case (
globals.css) was not in my original report — I noticed it while building this minimal repro, so the regression appears to affect a fourth parser as well.Pinning back to
0.7.2makes all four errors disappear (only formatting warnings remain). All traces pass throughprettier-plugin-tailwindcss/dist/index.mjs:303(the wrappedparser.parse).Let me know if there's anything else that would be helpful.
RobinMalfait commentedon Apr 27, 2026
Hey! If you bump prettier to the next minor release, then it should start working:
Or
pnpm install prettier@latestif you want to upgrade to the latest version, which is3.8.3at the time of writing this.I'll likely get another
0.7.xrelease out with the old version, and a new0.8.xto handle the breaking change. But this should help already 👍inouetakuya commentedon Apr 27, 2026
Thanks @RobinMalfait! Confirmed that bumping
prettierresolves all fourTypeErrors while keepingprettier-plugin-tailwindcss@0.7.3.Verified on the minimal repro repo:
prettier@3.7.4— all fourTypeErrors gone, only formatting warnings remainprettier@3.8.3— same resultVerification commits: https://github.com/inouetakuya/prettier-plugin-tailwindcss-v0.7.3-repro/tree/verify/prettier-bump-workaround
The repro README has also been updated with this workaround. Looking forward to the upcoming
0.7.xand0.8.xreleases — thanks again!chore(webapp): adopt prettier-plugin-tailwindcss, sort all class stri…
build(frontend): move tailwind-merge and the animation plugin to thei…
chore(deps): upgrade prettier-plugin-tailwindcss to ^0.8, prettier to…