Some CSS Modules Do Not Load
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- css, deno, typescript
- Domain
- frontend
Research direction
Start by running the linked reproduction with deno task dev and deno task build, then compare the generated CSS assets with the entryAssets array in _fresh/server/server-entry.mjs. The issue does not identify the Fresh source file responsible, so trace how CSS Module assets are discovered and included in the HTML. Done when affected CSS Modules load in both development and the built site without manually editing generated files.
Written by the indexing model from the issue text.
Description
(Please see https://github.com/StarFahx/DenoCssBugRepro for a repo with reproduction steps for this bug. I've copied out the info from the readme file there below:)
I've come across a bug that seems quite inconsistent to recreate. I've not been able to figure out a "minimal" reproduction: it seems to strike in the middle of development with no particular rhyme or reason, so I have taken the most recent project I was working on when it struck and removed any identifying features.
The issue is that sometimes Deno decides not to load in a css module (or sass module, if using sass-embedded: which I often do, but I've recreated the issue here from scratch with pure css modules only). When running deno task dev, the module(s) that are affected will not appear in the html at all; when running deno task build, the relevant css appears in _fresh/client/assets/server-entry-{hash}.css, which is not loaded into the html either. This I think is the key to figuring out why it's inconsistent and why only some modules are affected, but I'm not familiar enough with Fresh to hunt this down myself right now.
I am able to work around the issue by updating _fresh/server/server-entry.mjs manually: an entryAssets const is declared, and if the server-entry css file path is added to the array manually, the modules load as expected. This is not a particularly helpful workaround when developing as it only works with a production built version of the site, and does not therefore have file-tracking or any other useful dev features!
Recreation Steps
- Pull this repo
- In
/src, rundeno task dev - Opening the site in your browser (I am using Firefox v152.0.1, and running Deno v2.8.3 on Linux), confirm that the whole content of the page is full-width
- Confirm the same for the site hosted using
deno task build && deno serve --allow-read _fresh/server.js. - Amend
_fresh/server/server-entry.mjsas described in the workaround above. - Re-run the script in step 4 and confirm that most (but not all) of the content is fit to a central container, and that the title text is red.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 757
- Avg merge
- 3m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from freshframework/fresh
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freshframework/fresh#3920 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
freshframework/fresh#3833 ·
-
feat
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
freshframework/fresh#3803 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
freshframework/fresh#3918 · 1 comment · 4 reactions ·
-
Tab title doesn't update to <Head> <title> when navigating to a page with another <title>Possibly taken @1AbdullahButt claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 57/100
freshframework/fresh#3916 ·
All issues in freshframework/fresh
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tintinweb/pi-subagents#459 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
danielmiessler/LifeOS#2830 ·
Maintainers usually reply within 6 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: client enhancement priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
opensro-dev/opensro#3681 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day