tmcw / docbox

REST API documentation generator
ISC License
1.14k stars 190 forks source link

After run build script, docbox css broken #64

Closed nubilfi closed 6 years ago

nubilfi commented 6 years ago

Hi, I'm new to docbox and i have a little problem. Every time i run npm run buildscript it always ends up with a broken CSS, i'm using the default provided CSS, and when i inspect it, i got this error: Warning: PropclassNamedid not match. Server: "fixed-top fixed-right space-left16" Client: "fixed-top fixed-right undefined"

tmcw commented 6 years ago

🤔 Okay - well, for now it should be fine to ignore the warning because React re-renders that portion of the DOM correctly. The issue is due to that extra class - space-left16 - being derived from a media query that doesn't run on the server (the static build process) but does run in the client. Not sure how to resolve that cleanly - open to suggestions.

nubilfi commented 6 years ago

I decided to use react v15 to build it, and it works, no CSS issue anymore.

aipsel commented 6 years ago

Also, I found that revert the index.html file can solve this problem.

tmcw commented 6 years ago

This would be a great opportunity for someone to help and fix and contribute a PR! I'd love to review and merge such a PR.

jimlongo56 commented 6 years ago

Can confirm that changing package.json

"react": "~15.6.2", "react-dom": "~15.6.2",

resolves the build issue for me.