bennycondonB
Denoβ€’13mo ago
bennycondon

Problem resolving imports from tailwindcss npm package

I'm having a problem with Deno 2 resolving imports from the tailwindcss npm package. I've included my code as an example below. I have the following task and imports in a deno.json file:

{
  "tasks": {
    "tailwind": "deno run -A npm:tailwindcss@^3.4.15 --config=./tailwind.config.ts --input=./public/styles/input.css --output=./public/styles/output.css --minify"
  },
  "imports": {
    "@tailwindcss/forms": "npm:@tailwindcss/forms@^0.5.9",
    "tailwindcss": "npm:tailwindcss@^3.4.15"
  }
}


I have the following tailwind.config.ts:

import defaultTheme from "tailwindcss/defaultTheme.js";
import forms from "@tailwindcss/forms/src/index.js";

export default {
  content: ["src/**/*", "public/scripts/**/*"],
  theme: {
    screens: {
      xs: "425px",
      ...defaultTheme.screens,
    },
    extend: {
      fontFamily: {
        sans: ['"Outfit"', ...defaultTheme.fontFamily.sans],
      },
    },
  },
  plugins: [forms({ strategy: "base" })],
  future: {
    hoverOnlyWhenSupported: true,
  },
};


I run the deno task with: deno task tailwind, and I receive the following error: Error: Cannot find module 'tailwindcss/defaultTheme.js'.
Was this page helpful?