calumjames / htmlwebpackplugin-error-react-rendering

An example repo of an error I'm seeing when trying to render a React component that imports CSS into the index.html using HtmlWebpackPlugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An example app to demonstrate an error I'm seeing when trying to import SCSS into the React component being rendered into the index.html by HtmlWebpackPlugin.

Run the following commands inside the folder you clone:

npm install
npm start

Then navigate to localhost:3001.

As can be seen in branch no-loading-css, if the line that imports the SCSS in the Loading component is commented out, the app runs fine and the component is rendered into the resulting index.html. When that line is commented out, you see the following error:

Error: /Users/calumjames/htmlwebpackplugin-error-react-rendering/tools/webpack/indexRenderer:5396
return window && document && document.all && !window.atob;
^
ReferenceError: window is not defined

About

An example repo of an error I'm seeing when trying to render a React component that imports CSS into the index.html using HtmlWebpackPlugin


Languages

Language:JavaScript 89.6%Language:CSS 10.4%