tailwindcss-typography: Cannot read property '700' of undefined

What version of @tailwindcss/typography are you using?

v0.5.0-alpha.2

What version of Node.js are you using?

v16.11.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://github.com/alexmanzo/alex

Describe your issue

I just set up this repo, so it’s basically a blank slate. I installed both tailwindcss@next and @tailwindcss/typography@next. Attempting to run the project results in the following error:

TypeError: Cannot read properties of undefined (reading '700')
    at Object.module.exports [as typography] (alex/node_modules/@tailwindcss/typography/src/styles.js:16:65)

That particular line in the styles.js is:

color: theme('colors.gray.700', colors.gray[700]),

I haven’t yet tried overriding the config or anything, but wanted to flag it since these versions are still in alpha! I’d love to be able to use the newest versions as I work on this… happy to try fixes/workarounds!

Edit to add tailwind.config.cjs

const config = {
  content: ['./src/**/*.{html,js,svelte,ts}'],

  theme: {
    extend: {},
  },

  plugins: [require('@tailwindcss/typography')],
}

module.exports = config

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 12
  • Comments: 20 (3 by maintainers)

Most upvoted comments

@tailwindcss/typography 0.5.0 is for v3 and up, if you are using v2 make sure you use @tailwindcss/typography@0.4.* 👍

i got the same issue , how do you fixed it ? Thaks

for me, it fixed when I change the tailwindcss/typography to version 0.5.0-alpha.2

Whiiiiiiichhhhhh I now realize may have been incorrectly copied in from an old project, and probably should have been removed 1 whole version ago. 🤦🏽‍♂️