Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmeasday/next-safari-reproduction
Reproduction of an issue with nextjs and styled-components in safari
https://github.com/tmeasday/next-safari-reproduction
Last synced: about 2 months ago
JSON representation
Reproduction of an issue with nextjs and styled-components in safari
- Host: GitHub
- URL: https://github.com/tmeasday/next-safari-reproduction
- Owner: tmeasday
- Created: 2019-09-09T05:24:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T09:29:46.000Z (about 2 years ago)
- Last Synced: 2024-10-25T18:56:53.686Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 440 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# next-safari-reproduction
Reproduction of an issue with nextjs and styled-components in safariTo reproduce:
1. Run `yarn && yarn build && yart start`
2. Head to http://localhost:3000 in *safari*
3. Hold shift and hit the reload button.
4. Notice the text has dissappeared.What I *think* is happening:
In production mode, on the *client-side* styled-components doesn't write to the `innerHTML` of its style tags, instead it uses `document.styleSheets[0].addRule()` et al. to set styles (clearning the `innerHTML` that was done on the server render).
When you shift-reload, the `@import`-ed font file is still being fetched when the rewriting happens. This seems to cause Safari to melt down.