OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Cannot find module '@material-tailwind/react/utils/withMT'

  • Thread starter Thread starter Alwisteins
  • Start date Start date
A

Alwisteins

Guest
I'm creating a project using vite react-ts, then I'm trying to install the package @material-tailwind/react, I've made sure the package is installed in package.json with version

Code:
"@material-tailwind/react": "^2.0.7",

I've also configured tailwind.config.js as follows:

Code:
import withMT from "@material-tailwind/react/utils/withMT";

/** @type {import('tailwindcss').Config} */
module.exports = withMT({
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {},
    colors: {
      palette: {
        bg: "#f8f9fa",
        white: "#fff",
        down: "#FF1700",
        up: "#06FF00",
        100: "#4B49AC",
        200: "#eef2ff",
        300: "#7DA0FA",
        400: "#7978E9",
        500: "#F3797E",
      },
    },
  },
  plugins: [],
});

in the main.tsx section, I have also configured the following:

Code:
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index. css";

import { ThemeProvider } from "@material-tailwind/react";

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React. StrictMode>
    <ThemeProvider>
      <App />
    </ThemeProvider>
  </React. StrictMode>
);

why when I hover over import { ThemeProvider } from "@material-tailwind/react" I get typescript error 'Cannot find module '@material-tailwind/react' or its corresponding type declarations.'?

how to solve that error?

<p>I'm creating a project using vite react-ts, then I'm trying to install the package @material-tailwind/react, I've made sure the package is installed in package.json with version</p>
<pre><code>"@material-tailwind/react": "^2.0.7",
</code></pre>
<p>I've also configured tailwind.config.js as follows:</p>
<pre><code>import withMT from "@material-tailwind/react/utils/withMT";

/** @type {import('tailwindcss').Config} */
module.exports = withMT({
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
colors: {
palette: {
bg: "#f8f9fa",
white: "#fff",
down: "#FF1700",
up: "#06FF00",
100: "#4B49AC",
200: "#eef2ff",
300: "#7DA0FA",
400: "#7978E9",
500: "#F3797E",
},
},
},
plugins: [],
});
</code></pre>
<p>in the main.tsx section, I have also configured the following:</p>
<pre><code>import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./index. css";

import { ThemeProvider } from "@material-tailwind/react";

ReactDOM.createRoot(document.getElementById("root")!).render(
<React. StrictMode>
<ThemeProvider>
<App />
</ThemeProvider>
</React. StrictMode>
);
</code></pre>
<p>why when I hover over import { ThemeProvider } from "@material-tailwind/react" I get typescript error 'Cannot find module '@material-tailwind/react' or its corresponding type declarations.'?</p>
<p>how to solve that error?</p>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top