{"id":2842,"date":"2020-04-01T19:20:38","date_gmt":"2020-04-01T18:20:38","guid":{"rendered":"https:\/\/www.dpscomputing.com\/blog\/?p=2842"},"modified":"2021-03-01T21:25:18","modified_gmt":"2021-03-01T21:25:18","slug":"getting-started-with-isomorphic-react-at-pluralsight","status":"publish","type":"post","link":"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/01\/getting-started-with-isomorphic-react-at-pluralsight\/","title":{"rendered":"Getting Started with Isomorphic React at Pluralsight"},"content":{"rendered":"\n<p>Isomorphic React, for many reasons, is gaining traction with many developers.  Not least for the SEO benefits &#8211; or should we say that massive SEO pitfalls of *NOT* using isomorphic React.  Blank pages for Googlebot anyone?  <\/p>\n\n\n\n<p>Anyway, a great course available for this very topic, that covers <a href=\"https:\/\/app.pluralsight.com\/library\/courses\/isomorphic-react\">Isomorphic React in a concise fashion<\/a> is Dan Sterns course over at Pluralsight.  <\/p>\n\n\n\n<p>I myself have also started looking at this course &#8211; and for anyone else who has started recently, they may have hit a snag with the demo.  <\/p>\n\n\n\n<p>Dan provides a starting template for the course &#8211; only issue is, that the template falls over with an error after you&#8217;ve followed the initial instructions to npm install, npm post install and npm start in the second module &#8216;Course Introduction&#8217;.  <\/p>\n\n\n\n<p>A few people have been discussing this on the <a href=\"https:\/\/app.pluralsight.com\/library\/courses\/isomorphic-react\/discussion\">Isomorphic React course discussion page<\/a> and a few people have tried to help, but it appears Dan hasn&#8217;t had a chance to provide an update yet &#8211; probably because he&#8217;s uber busy with a load of other things at the moment as many of us are!  <\/p>\n\n\n\n<p>Unfortunately, there&#8217;s a couple of pieces of the answer missing to get up and running and some helpful steps along the way that are spread out so I&#8217;m writing this article to put the solution in one place.  Don&#8217;t worry, I will of course also be submitting a pull request to Daniel to help get this fixed in the git repo also.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Issue with the Isomorphic React Template<\/h2>\n\n\n\n<p>So, you followed all the instructions, you&#8217;re raring to go and boom!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"394\" height=\"83\" data-attachment-id=\"2843\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/01\/getting-started-with-isomorphic-react-at-pluralsight\/image-34\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image.png\" data-orig-size=\"394,83\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-300x63.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image.png\" alt=\"\" class=\"wp-image-2843\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image.png 394w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-300x63.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-150x32.png 150w\" sizes=\"auto, (max-width: 394px) 100vw, 394px\" \/><\/figure><\/div>\n\n\n\n<p>So what does this mean?  Short answer, the app isn&#8217;t running.  <\/p>\n\n\n\n<p>Slightly longer answer (just about!): Uglify can&#8217;t understand the pretty new ES6 syntax that we&#8217;re all using (or should be using!) by now.  <\/p>\n\n\n\n<p>Full error stack included below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\Pluralsight\\Isomorphic-React\\&gt; npm start\n\n&gt; isomorphic-react@1.0.0 start C:\\Pluralsight\\Isomorphic-React\\isomorphic-react\n&gt; npm run start-prod\n\n\n&gt; isomorphic-react@1.0.0 start-prod C:\\Pluralsight\\Isomorphic-React\\\n&gt; npm run build &amp;&amp; cross-env NODE_ENV=production babel-node server --useServerRender=true --useLiveData=false\n\n\n&gt; isomorphic-react@1.0.0 build C:\\Pluralsight\\Isomorphic-React\\\n&gt; cross-env webpack --config .\/webpack.config.prod.babel.js\n\nC:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:178\n    throw new Error(`Plugin\/Preset files are not allowed to export objects, only functions. In ${filepath}`);\n    ^\n\nError: Plugin\/Preset files are not allowed to export objects, only functions. In C:\\Pluralsight\\Isomorphic-React\\node_modules\\babel-preset-es2015\\lib\\index.js      \n    at createDescriptor (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:178:11)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:109:50\n    at Array.map (&lt;anonymous&gt;)\n    at createDescriptors (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:109:29)\n    at createPresetDescriptors (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:101:10)\n    at presets (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-descriptors.js:47:19)\n    at mergeChainOpts (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-chain.js:320:26)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-chain.js:283:7\n    at buildRootChain (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\config-chain.js:120:22)\n    at loadPrivatePartialConfig (C:\\Pluralsight\\Isomorphic-React\\node_modules\\@babel\\core\\lib\\config\\partial.js:85:55)\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 build: `cross-env webpack --config .\/webpack.config.prod.babel.js`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_35_22_069Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start-prod: `npm run build &amp;&amp; cross-env NODE_ENV=production babel-node server --useServerRender=true --useLiveData=false`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 start-prod script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_35_22_139Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start: `npm run start-prod`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 start script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_35_22_237Z-debug.log<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Fixing Isomorphic React Template<\/h2>\n\n\n\n<p>The two main areas that need updating are the depdencies and the webpack configuration.  I&#8217;ll detail the specific steps below.  <\/p>\n\n\n\n<p>There&#8217;s obviously more than one way to skin a cat &#8211; or, in this case, fix a programming template, but we&#8217;ve tried and tested this way and all seems fine up to now (we&#8217;ll provide updates here if we discover any issues or come up with a more optimum fix).  <\/p>\n\n\n\n<p>The main steps are to teach Uglify ES6 (via the very handy uglifyjs-webpack-plugin), upgrade webpack &#8211; including adding the recommended webpack command line interface and then substituting the webpack config and including some nice new config features that are part of Webpack 4.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 &#8211; Upgrade Webpack<\/h2>\n\n\n\n<p>We&#8217;re going to take advantage of some new features of Webpack (such as the optimisation configuration) and this requires an upgrade to Webpack 4.x<\/p>\n\n\n\n<p>You can:<\/p>\n\n\n\n<p>Run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm update webpack<\/pre>\n\n\n\n<p>Or Change the package.json file directly and run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install<\/pre>\n\n\n\n<p>Or you can run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm uninstall webpack\nnpm install webpack<\/pre>\n\n\n\n<p>To install the latest version (currently 4.42.1).  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 &#8211; Add The Webpack CLI<\/h2>\n\n\n\n<p>This isn&#8217;t included in the original template &#8211; but is a recommended part of Webpack 4.x so we ought to add it.  <\/p>\n\n\n\n<p>You can do this by running the following command in Powershell:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install webpack-cli<\/pre>\n\n\n\n<p>If you get giddy and forget this step, you will get a reminder when we start later that the command line interface is missing and you ought to add it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:\n - webpack-cli (https:\/\/github.com\/webpack\/webpack-cli)\n   The original webpack full-featured CLI.\nWe will use \"npm\" to install the CLI via \"npm install -D\".\nDo you want to install 'webpack-cli' (yes\/no):<\/code><\/pre>\n\n\n\n<p>Enter &#8216;yes&#8217; here at the prompt and the default webpack-cli will be installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Installing 'webpack-cli' (running 'npm install -D webpack-cli')...\nnpm WARN webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.\nnpm WARN isomorphic-react@1.0.0 No repository field.\nnpm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\\fsevents):\nnpm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {\"os\":\"darwin\",\"arch\":\"any\"} (current: {\"os\":\"win32\",\"arch\":\"x64\"})\n\n+ webpack-cli@3.3.11\nadded 38 packages from 24 contributors and audited 870908 packages in 22.005s\n\n1 package is looking for funding\n  run `npm fund` for details<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 &#8211; Install UglifyJS Webpack Plugin<\/h2>\n\n\n\n<p>Remember when we said we have to teach Uglify JS ES6?  Don&#8217;t worry, it&#8217;s not like homeschooling!  The UglifyJS Webpack Plugin will do the heavy lifting for us!<\/p>\n\n\n\n<p>This isn&#8217;t part of the template project so we just need to npm install the latest version:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install uglifyjs-webpack-plugin<\/pre>\n\n\n\n<p>That&#8217;ll whirl away as usual and install in the background.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 &#8211; Updating the Webpack Config<\/h2>\n\n\n\n<p>Now onto the final step &#8211; updating the webpack config.  <\/p>\n\n\n\n<p>One of the key differences is what we&#8217;ll need to include our new UglifyJS Webpack plugin that we installed in the previous step:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const UglifyJsPlugin = require('uglifyjs-webpack-plugin');<\/code><\/pre>\n\n\n\n<p>This should be included at the top along with the path and webpack dependencies.  <\/p>\n\n\n\n<p>Then we add a mode:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&#8216;<strong>development<\/strong>&#8216;: for <em>webpack.config.dev.babel.js<\/em><\/li><li>&#8216;<strong>production<\/strong>&#8216;: for <em>webpack.config.prod.babel.js<\/em><\/li><\/ul>\n\n\n\n<p>The next major change is the addition of a brand new optimisation (or optimization in American English) object which includes a minimiser (minimizer) array that calls our newly included UglifyJS plugin to, among other things, parse ES6 and sort out the source maps.  <\/p>\n\n\n\n<p>There are some other minor changes and renames for Webpack 4 compatibility but we won&#8217;t cover them explicitly in detail at the moment.  <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">New Dev Webpack Configuration<\/h3>\n\n\n\n<p>Below is the complete development Webpack configuration with all the updates required included.  Feel free to drop this straight into your <em>webpack.config.dev.babel.js<\/em> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const path = require('path');\nconst UglifyJsPlugin = require('uglifyjs-webpack-plugin');\nconst webpack = require('webpack');\n\nmodule.exports = {\n    mode: 'development',\n    entry: &#91;\n        'babel-regenerator-runtime',\n        path.resolve(__dirname, 'src')\n    ],\n    output: {\n        path: path.resolve(__dirname, 'dist'),\n        filename: 'bundle.js',\n        publicPath: '\/'\n    },\n    optimization: {\n        minimizer: &#91;\n            \/\/ we specify a custom UglifyJsPlugin here to get source maps in production\n            new UglifyJsPlugin({\n                cache: true,\n                parallel: true,\n                uglifyOptions: {\n                    compress: false,\n                    ecma: 6,\n                    mangle: true\n                },\n                sourceMap: true\n            })\n        ]\n    },\n    plugins: &#91;\n        new webpack.DefinePlugin({\n            'process.env': {\n                NODE_ENV: JSON.stringify('production'),\n                WEBPACK: true\n            }\n        }),\n        \/*\n        * Uglifies JS which improves performance\n        * React will throw console warnings if this is not implemented\n        *\/\n    ],\n    resolve: {\n        extensions: &#91;'.js', '.json', '.jsx'],\n    },\n    module: {\n        rules: &#91;\n            {\n                test: \/.jsx?$\/,\n                use: {\n                    loader: 'babel-loader'\n                },\n                include: path.resolve(__dirname, 'src')\n            }\n        ]\n    }\n};<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">New Production Webpack Config<\/h3>\n\n\n\n<p>For the webpack.config.prod.babel.js, the main change is to update the mode to &#8216;production&#8217; to take advantage of additional optimisations available for a build environment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mode: 'production'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">The New Webpack Config Doesn&#8217;t Work!<\/h2>\n\n\n\n<p>It does, trust me!  The error you&#8217;re probably encountering is that you&#8217;ve skipped updating the webpack depedency &#8211; this is by far the most common.  As the new configuration takes advantage of some new features of Webpack 4 &#8211; such as optimisation &#8211; Webpack 3.x will throw a hissy fit if you don&#8217;t upgrade:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1371\" height=\"190\" data-attachment-id=\"2844\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/01\/getting-started-with-isomorphic-react-at-pluralsight\/image-1-10\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1.png\" data-orig-size=\"1371,190\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-300x42.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-1024x142.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/i1.wp.com\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1.png?fit=1024%2C142&amp;ssl=1\" alt=\"Invalid configuration object - optimisation - Webpack 3.x\" class=\"wp-image-2844\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1.png 1371w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-300x42.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-1024x142.png 1024w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-150x21.png 150w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-1-768x106.png 768w\" sizes=\"auto, (max-width: 1371px) 100vw, 1371px\" \/><\/figure><\/div>\n\n\n\n<p>The full error stack is included below for convienience:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS C:\\Pluralsight\\Isomorphic-React&gt; npm start\n\n&gt; isomorphic-react@1.0.0 start C:\\Pluralsight\\Isomorphic-React\n&gt; npm run start-prod\n\n\n&gt; isomorphic-react@1.0.0 start-prod C:\\Pluralsight\\Isomorphic-React\n&gt; npm run build &amp;&amp; cross-env NODE_ENV=production babel-node server --useServerRender=true --useLiveData=false\n\n\n&gt; isomorphic-react@1.0.0 build C:\\Pluralsight\\Isomorphic-React\n&gt; cross-env webpack --config .\/webpack.config.prod.babel.js\n\nInvalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.\n - configuration has an unknown property 'optimization'. These properties are valid:\n   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, \nrecordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stats?, target?, watch?, watchOptions? }\n   For typos: please correct them.\n   For loader options: webpack 2 no longer allows custom properties in configuration.\n     Loaders should be updated to allow passing options via loader options in module.rules.\n     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:\n     plugins: &#91;\n       new webpack.LoaderOptionsPlugin({\n         \/\/ test: \/\\.xxx$\/, \/\/ may apply this only for some modules\n         options: {\n           optimization: ...\n         }\n       })\n     ]\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 build: `cross-env webpack --config .\/webpack.config.prod.babel.js`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_49_53_357Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start-prod: `npm run build &amp;&amp; cross-env NODE_ENV=production babel-node server --useServerRender=true --useLiveData=false`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 start-prod script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_49_53_424Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start: `npm run start-prod`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T15_49_53_507Z-debug.log\nPS C:\\Pluralsight\\Isomorphic-React&gt; rm -rf node_modules\nAt line:1 char:4\n+ rm -rf node_modules\n+    ~~~\n    + CategoryInfo          : InvalidArgument: (:) &#91;Remove-Item], ParameterBindingException\n    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand<\/code><\/pre>\n\n\n\n<p>Go back to Step 1 above, upgrade webpack and you should be sorted!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Error: Cannot find module!<\/h2>\n\n\n\n<p>Sounds like you&#8217;ve skipped step 3 &#8211; installing the uglify-js-webpack-plugin.  Go back and do this and you should be good to go.  The good news is, step 4 &#8211; replacing webpack config went well if you&#8217;re getting this error message!<\/p>\n\n\n\n<p>Full error stack for this one is listed below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Error: Cannot find module 'uglifyjs-webpack-plugin'\nRequire stack:\n- C:\\Pluralsight\\Isomorphic-React\\webpack.config.prod.babel.js\n- C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js\n- C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\cli.js\n- C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack\\bin\\webpack.js\n    at Function.Module._resolveFilename (internal\/modules\/cjs\/loader.js:797:15)\n    at Function.Module._load (internal\/modules\/cjs\/loader.js:690:27)\n    at Module.require (internal\/modules\/cjs\/loader.js:852:19)\n    at require (C:\\Pluralsight\\Isomorphic-React\\node_modules\\v8-compile-cache\\v8-compile-cache.js:161:20)\n    at Object.require (C:\\Pluralsight\\Isomorphic-React\/webpack.config.prod.babel.js:2:24)\n    at Module._compile (C:\\Pluralsight\\Isomorphic-React\\node_modules\\v8-compile-cache\\v8-compile-cache.js:192:30)\n    at Module._compile (C:\\Pluralsight\\Isomorphic-React\\node_modules\\pirates\\lib\\index.js:99:24)\n    at Module._extensions..js (internal\/modules\/cjs\/loader.js:995:10)\n    at Object.newLoader &#91;as .js] (C:\\Pluralsight\\Isomorphic-React\\node_modules\\pirates\\lib\\index.js:104:7)\n    at Module.load (internal\/modules\/cjs\/loader.js:815:32)\n    at Function.Module._load (internal\/modules\/cjs\/loader.js:727:14)\n    at Module.require (internal\/modules\/cjs\/loader.js:852:19)\n    at require (C:\\Pluralsight\\Isomorphic-React\\node_modules\\v8-compile-cache\\v8-compile-cache.js:161:20)\n    at WEBPACK_OPTIONS (C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js:114:13)\n    at requireConfig (C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js:116:6)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js:123:17\n    at Array.forEach (&lt;anonymous&gt;)\n    at module.exports (C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js:121:15)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\cli.js:71:45\n    at Object.parse (C:\\Pluralsight\\Isomorphic-React\\node_modules\\yargs\\yargs.js:567:18)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\cli.js:49:8\n    at Object.&lt;anonymous&gt; (C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack-cli\\bin\\cli.js:366:3)\n    at Module._compile (internal\/modules\/cjs\/loader.js:959:30)\n    at Object.Module._extensions..js (internal\/modules\/cjs\/loader.js:995:10)\n    at Module.load (internal\/modules\/cjs\/loader.js:815:32)\n    at Function.Module._load (internal\/modules\/cjs\/loader.js:727:14)\n    at Module.require (internal\/modules\/cjs\/loader.js:852:19)\n    at require (internal\/modules\/cjs\/helpers.js:74:18)\n    at C:\\Pluralsight\\Isomorphic-React\\node_modules\\webpack\\bin\\webpack.js:143:5\n    at processTicksAndRejections (internal\/process\/task_queues.js:93:5) {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: &#91;\n    'C:\\\\Pluralsight\\\\Isomorphic-React\\\\webpack.config.prod.babel.js',\n    'C:\\\\Pluralsight\\\\Isomorphic-React\\\\node_modules\\\\webpack-cli\\\\bin\\\\utils\\\\convert-argv.js',\n    'C:\\\\Pluralsight\\\\Isomorphic-React\\\\node_modules\\\\webpack-cli\\\\bin\\\\cli.js',\n    'C:\\\\Pluralsight\\\\Isomorphic-React\\\\node_modules\\\\webpack\\\\bin\\\\webpack.js'\n  ]\n}\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 build: `cross-env webpack --config .\/webpack.config.prod.babel.js`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T16_02_09_115Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start-prod: `npm run build &amp;&amp; cross-env NODE_ENV=production babel-node server --useServerRender=true --useLiveData=false`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the isomorphic-react@1.0.0 start-prod script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T16_02_09_312Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! isomorphic-react@1.0.0 start: `npm run start-prod`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the isomorphic-react@1.0.0 start script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\DPS Computing\\AppData\\Roaming\\npm-cache\\_logs\\2020-03-31T16_02_09_395Z-debug.log<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Still Got An Issue?<\/h2>\n\n\n\n<p>Let us know in the comments below and we&#8217;ll try to help solve!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What About That Pull Request?<\/h2>\n\n\n\n<p>I know, I promised didn&#8217;t I?  Don&#8217;t worry, I&#8217;ll get it over to <a href=\"https:\/\/github.com\/danielstern\/isomorphic-react\/\">Dan<\/a> ASAP.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Isomorphic React, for many reasons, is gaining traction with many developers. Not least for the SEO benefits &#8211; or should we say that massive SEO pitfalls of *NOT* using isomorphic React. Blank pages for&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Getting Started with Isomorphic #React at #Pluralsight\n\nIncluded update working template and #Webpack 4 upgrade\n\n#IsomorphicReact #ReactDevelopment #WebDevelopment #UglifyJS #ES6","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2138],"tags":[2679,2678,2681,2674,2677,2676,2680,2675,2683,2684,2682],"class_list":["post-2842","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-code-whisperer","tag-daniel-stern","tag-error-in-bundle-js","tag-isomorphic-react","tag-isomorphic-react-at-pluralsight","tag-isomorphic-react-course","tag-isomorphic-react-template","tag-react-development","tag-uglifyjs-es6-configuration","tag-uglifyjs-webpack","tag-unexpected-token-punc"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image.png","jetpack_shortlink":"https:\/\/wp.me\/p3nsfA-JQ","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/comments?post=2842"}],"version-history":[{"count":3,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2842\/revisions"}],"predecessor-version":[{"id":3000,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2842\/revisions\/3000"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media\/2843"}],"wp:attachment":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media?parent=2842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/categories?post=2842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/tags?post=2842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}