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

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

Update webpack.config.client.js const config's devtool property #118

Open Jacob-Hoff-man opened 2 years ago

Jacob-Hoff-man commented 2 years ago

""The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unauthorized code on your site.

To solve this issue, avoid using eval(), new Function(), setTimeout([string], ...) and setInterval([string], ...) for evaluating strings.""

Error when using Google Chrome to render the project to the browser--only in development mode--that inhibited the browser's ability to render the UI from webpack bundle.

Switching devtool property of const config in the webpack.config.client.js file resolved the issue for me. I tried to avoid a source-map option that utilized the use of eval().

Source-map options to select for devtool property can be found here: https://webpack.js.org/configuration/devtool/

league commented 2 years ago

:+1: Thanks for reporting this, I had the same issue and this change solved it.