esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.04k stars 146 forks source link

Failed to import - `/_virtual/esm.sh/v134/tailwindcss@3.3.5/denonext/css/preflight.css` #776

Closed marvinhagemeister closed 6 months ago

marvinhagemeister commented 9 months ago

Failing module

import postcss from "npm:postcss@8.4.31";
import tailwindCss from "https://esm.sh/tailwindcss@3.3.5";

const res = await postcss([
  tailwindCss({
    content: [{ raw: '<div class="font-bold">', extension: "html" }],
  }) as any,
]).process(".foo { color: red }", { from: undefined });

console.log(res);

Run the above code with deno run -A myfile.ts

Error message

After running deno run I got this:

Uncaught NotFound: No such file or directory (os error 2): readfile '/_virtual/esm.sh/v134/tailwindcss@3.3.5/denonext/css/preflight.css'

It seems like a __dirname variable is rewritten incorrectly. The path should point at /denonext/lib/css/preflight.css instead of /denonext/css/preflight.css.

Additional info

Ducky07 commented 7 months ago

Bump for 2024 I'd love to use tailwindcss with my own deno/fresh projects with esm rather than having to get tailwindcss from npm. Everything else I already use can be contained within the esm ecosystem, tailwindcss is the only thing I have to get through npm right now.

ije commented 7 months ago

i will check!