tailwindcss: TypeError: Cannot read properties of undefined (reading '700')
What version of Tailwind CSS are you using? “tailwindcss”: “^3.0.1”,
What build tool (or framework if it abstracts the build tool) are you using? “postcss”: “^8.3.11”, Angular 13 ,
What version of Node.js are you using? node : v16.13.0
What browser are you using? Chrome,
What operating system are you using? Ubuntu 20.04
Describe your issue after I update Tailwindcss on my angular 13 project I get the below error when I try to run the project I try to look into these files I found that the gray color has problems or is even not found also I have a custom tailwind.config
TypeError: Cannot read properties of undefined (reading '700') at module.exports ( node_modules/@tailwindcss/typography/src/styles.js:16:65) at value ( node_modules/tailwindcss/lib/util/resolveConfig.js:68:41) at node_modules/tailwindcss/lib/util/resolveConfig.js:132:24 at Array.map (<anonymous>) at Object.typography ( node_modules/tailwindcss/lib/util/resolveConfig.js:132:15) at node_modules/tailwindcss/lib/util/resolveConfig.js:155:57 at Array.reduce (<anonymous>) at resolveFunctionKeys (node_modules/tailwindcss/lib/util/resolveConfig.js:152:32) at Object.resolveConfig [as default] (node_modules/tailwindcss/lib/util/resolveConfig.js:224:16) at Object.resolveConfig [as default] (node_modules/tailwindcss/lib/public/resolve-config.js:15:39)
here is the code where styles.js throw error:
module.exports = (theme) => ({ DEFAULT: { css: [ { color: theme('colors.gray.700', defaultTheme.colors.gray[700]), }]}
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 12
- Comments: 24 (1 by maintainers)
Commits related to this issue
- fix: downgrade tailwindcss/typography from 0.5.1 to 0.4.1 See https://github.com/tailwindlabs/tailwindcss/issues/6398 — committed to bytebase/bytebase.com-old by tianzhou 2 years ago
@samehsy could you update the version of
@tailwindcss/typographyyou’re using?This is causing issues with older versions of
@tailwindcss/formsas well.I specifically had the problem using nuxt/tailwindcss-module with
"@tailwindcss/typography": "^0.5.0",, which seems to not be compatible anymore with tailwindcss < 3.0.0.The Nuxt TailwindCSS module uses tailwind:“^2.0.4” and is not upgraded yet to Tailwind 3, see https://github.com/nuxt-community/tailwindcss-module/pull/407
Downgrading to
"@tailwindcss/typography": "^0.4.1",works for me!Try the latest:
npm i @tailwindcss/typography@latest😃(You may want to update the forms as well,
npm i @tailwindcss/forms@latest.)Can we re-open this issue? It’s still happening.
@tailwind/uineeds to update the@tailwind/typographydependency to^0.5.0in order to fix the issue and work with v3, otherwise we can’t use@tailwind/uion v3 yet.Remove
@tailwindcss/ui, that package was made obsolete when Tailwind CSS v2.0 was released back in 2020 👍🏻I also found this issue in 0.5.2, so I have also downgraded to 0.4.1 to resolve it.
default nuxt3 installation here with
tailwindcss ^3.0.7:It appears
^0.5.0and^0.4.0are latest for typography and forms respectively. Still receiving this error on build:Tailwind config js:
I’ve attempted to downgrade typography to 0.4.1 with no luck.
UPDATE: This appears to have been caused by
@tailwindcss/uirequirement in thepluginssection oftailwind.config.js. Removing that allows the app to build.I do not have tailwindcss/ui dependency but I still have this issue in typography pugin version above 0.4.1 😕
None of the highest voted answered fix this for me. As mklueh stated: ‘“@tailwindcss/typography”: “^0.4.1”,’
I had this issue too after installing
@tailwind/typography, but I had forgotten to update Tailwind to version 3 from 2 in an old project. Tailwind 3 came out in November 2021, so I’m sure I’m not the only one. 😅Thanks, It fixed the problem. 😃
Could you change the
colors.gray.700to justcolors.gray?@nbgoodall thank you I appreciate your help …you are right I forgot to update @tailwindcss/typography @bolshoytoster also thanks
I’m experiencing the same issue related to the ‘700’ property.
/node_modules/@tailwindcss/ui/node_modules/@tailwindcss/typography/src/styles.js:15:40This seems like to be an outdated dependency in the
@tailwind/uipackage. I have explored the package and noticed it uses"@tailwindcss/typography": "^0.2.0"and tailwind 3.0 only works with"@tailwindcss/typography": "^0.5.0".Google brought me here with the same issue - and same embarrassing omission on my part: had forgotten to update typography . thanks a bunch