withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.43k stars 2.46k forks source link

Tailwind CSS not rendering for symlink (soft link) .astro files #8881

Open dotfrag opened 1 year ago

dotfrag commented 1 year ago

Astro Info

Astro                    v3.3.2
Node                     v18.18.0
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Tailwind CSS will not render on .astro files that are symlinks.

What's the expected result?

I would expect CSS to be rendered the same for the regular file and its symlink'ed file. This is incredibly useful for i18n projects where a page is the same for all languages.

Link to Minimal Reproducible Example

https://github.com/dotfrag/astro-symlink-tailwind-issue

Participation

dotfrag commented 1 year ago

I'm not sure if this is an Astro or Vite issue.

florian-lefebvre commented 9 months ago

@dotfrag does #8262 workaround also work in your case?

dotfrag commented 9 months ago

@florian-lefebvre I have tried this but it throws an error:

Error: Cannot find module 'html-escaper' imported from '/home/frag/tmp/astro-symlink-tailwind-issue/node_modules/astro/dist/runtime/server/escape.js'
    at nodeImport (file:///home/frag/tmp/astro-symlink-tailwind-issue/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56088:25)
    at ssrImport (file:///home/frag/tmp/astro-symlink-tailwind-issue/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55990:30)
    at eval (/home/frag/tmp/astro-symlink-tailwind-issue/node_modules/astro/dist/runtime/server/escape.js:3:50)
    at instantiateModule (file:///home/frag/tmp/astro-symlink-tailwind-issue/node_modules/.pnpm/vite@4.5.0/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:15)

It looks like this config option only works in server mode. I'm using default (SSG).