Skip to content
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

can't get my css served in a react universal app! #120

Closed
elhariri opened this issue May 2, 2018 · 9 comments
Closed

can't get my css served in a react universal app! #120

elhariri opened this issue May 2, 2018 · 9 comments

Comments

@elhariri
Copy link

elhariri commented May 2, 2018

Hi, i'm trying to build an isomorphic react application, i've added mini-css-extract-plugin in my client webpack config. in my server i'm using renderToString and pushing the string in my html like this :

<!DOCTYPE html>
  <html>
    <head>
    // usual stuff
    </head>
    <body>
      <div id="app">
        ${html}   // here goes the rendered html
      </div>
      <script type="text/javascript"  src=".dist/public/bundle.js"></script>
    </body>
  </html>

the build is compiled perfectly but i can't get css on my page (the css file is imported in my root component app)

@alexander-akait
Copy link
Member

@elhariri can you create minimum reproducible test repo?

@elhariri
Copy link
Author

elhariri commented May 2, 2018

@evilebottnawi i'm new to development in general and i'm afraid that it would take me a lot of time to create it (i'm creating for free a free educational wwebsite for a non lucratif association and it's really taking me a lot of time) so is it ok if i just copied my server, my client and server webpack config and my main react component files if it's ok i'll post them as soon as possible i don't have my laptop with me.

@alexander-akait
Copy link
Member

@elhariri feel free to ping me when you done this. Thanks minimum reproducible test repo it is hard to detect where problem happens

@elhariri
Copy link
Author

elhariri commented May 2, 2018

@evilebottnawi thanks for your support this the url https://github.com/elhariri/react-universal-v1

@alexander-akait
Copy link
Member

alexander-akait commented May 2, 2018

@elhariri i can't find html file in your repo 😕

@elhariri
Copy link
Author

elhariri commented May 2, 2018

@evilebottnawi i servit directly from the server with the renderFullPage function, if it's not a good practice please guide me

@alexander-akait
Copy link
Member

@elhariri i can't know it is good solution for your use case or not, please use for this stackoverflow, gitter or slack

@elhariri
Copy link
Author

elhariri commented May 2, 2018

Oooh sorry, and thank you for your reply :).

@alexander-akait
Copy link
Member

@elhariri feel free to feedback if you some questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants