-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WMR]: Stylesheets not clearing between pages being prerendered #25
Comments
If it works great! I remember we had some problems with tracking of the current async scopes. If it works with an async function now, we should change it. |
Somewhat related issue? #26 |
Yep, this seems to be the culprit (I use my own |
...also note that if a unit-test was to be written for this, Twind's |
UPDATE: NO! To Ryan's original point: -I removed- the |
I think you skipped looking over the blame that resulted in that line. Without it, pages that contain shared styles would end up missing it. Say |
OH! I retract this comment, sorry. This totally yields empty stylesheet in my tests. I am keeping the Promise.resolve() wrapper as this has been working great in my setup which is very similar to |
@sastan: do you happen to remember the context of this comment?
use-twind-with/packages/wmr/prerender.ts
Lines 22 to 24 in d40071a
Running into an issue at the moment where previous styles aren't cleared from the stylesheet, and for whatever reason, this seems to be the culprit.
I've made a reproduction: https://github.com/rschristian/twind-uncleared-sheet-bug
This is just the WMR Example brought up to date and configured to also prerender a 'Not Found' page.
Once you build (
npm run build
), if you look at the built file (dist/404/index.html
) you'll see that Twind has generated a rule for.bg-purple-400
, even though it doesn't exist on any content in the page. It does, however, exist in/
.I'm not really sure what you're looking to do with that
Promise.resolve().then(...)
. Replacing that and returning a plain async function seems to fix the issue.The text was updated successfully, but these errors were encountered: