question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing declaration file for "tailwindcss/resolveConfig"

See original GitHub issue

What version of Tailwind CSS are you using?

For example: v3.1.6

What build tool (or framework if it abstracts the build tool) are you using?

Vite, Typescript

What version of Node.js are you using?

For example: v16.15.1

What browser are you using?

Chrome

What operating system are you using?

Windows 10

Reproduction URL

https://github.com/joshmossas/tailwindcss-resolve-config-missing-types

Describe your issue

When attempting to use the resolveConfig helper in a typescript project you get a type error Could not find a declaration file for module 'tailwindcss/resolveConfig'.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
joshmossascommented, Jul 21, 2022

For anyone that needs a quick work-around, create a .d.ts file (ex tailwind-resolve-config.d.ts) in your types/typings directory with the following

declare module 'tailwindcss/resolveConfig' {
    import type { Config } from 'tailwindcss';

    declare function resolveConfig(config: Config): Config;
    export = resolveConfig;
}
1reaction
thecrypticacecommented, Jul 25, 2022

Hey, I merged in your PR. This will be in our insiders build until we tag a new release (likely tomorrow). Thanks again for the PR! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration
Any missing sections will fall back to Tailwind's default configuration. ​. Creating your configuration file. Generate a Tailwind config file for your project ......
Read more >
How to use TailwindCSS's resolve config with Typescript
The only problem here is I can't have /** @type {import('tailwindcss').Config} */ in the config file itself, because IDE starts to resolve ...
Read more >
Configuration
Any missing sections will fall back to Tailwind's default configuration. Creating your configuration file. Generate a Tailwind config file for your project ...
Read more >
“ts could not find a declaration file for module for own module” ...
When a module is not yours - try to install types from @types: npm install -D @types/module-name // If the above install errors...
Read more >
tailwindcss | Yarn - Package Manager
Changelog. All notable changes to this project will be documented in this file. The format is based on Keep a Changelog, and this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found