PacktPublishing / Full-Stack-React-Projects-Second-Edition

Full-Stack React Projects - Second Edition, published by Packt
MIT License
461 stars 538 forks source link

Rendering a home page view #54

Closed HashOil1 closed 3 years ago

HashOil1 commented 3 years ago

Hi!, I have a problem when I try to Rendering the home page view. The problem occurs when i go to localhost:3000, I only see blank page and components are not rendered :(. When i start the server all its ok, but i don't understand why happend this. I checked that my code is the same that the code in github. If you need more information to help me I am attentive to your comments. Thx!

image

HashOil1 commented 3 years ago

I add some aditional information

image

HashOil1 commented 3 years ago

I fixed it by removing the "helmet" npm package. I don't understand why, but now this works fine. Anyone can explain to me what happened?.

edit: This solution only work with firefox, but the problem still continue in google chrome :(

shruthis-shetty commented 3 years ago

Thanks for the solution @HashOil1.

panduananto commented 3 years ago

i got it working with helmet by setting it up like this:

app.use(
  helmet({
    contentSecurityPolicy: {
      directives: {
        ...helmet.contentSecurityPolicy.getDefaultDirectives(),
        'script-src': ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
      },
    },
  })
);
HashOil1 commented 3 years ago

i got it working with helmet by setting it up like this:

app.use(
  helmet({
    contentSecurityPolicy: {
      directives: {
        ...helmet.contentSecurityPolicy.getDefaultDirectives(),
        'script-src': ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
      },
    },
  })
);

Thank you very much!, you helped me a lot with your answer.

oriankeith002 commented 1 year ago

i got it working with helmet by setting it up like this:

app.use(
  helmet({
    contentSecurityPolicy: {
      directives: {
        ...helmet.contentSecurityPolicy.getDefaultDirectives(),
        'script-src': ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
      },
    },
  })
);

Thanks for your solution, it was very helpful