{"id":2867,"date":"2020-04-30T06:50:47","date_gmt":"2020-04-30T05:50:47","guid":{"rendered":"https:\/\/www.dpscomputing.com\/blog\/?p=2867"},"modified":"2021-03-01T21:23:40","modified_gmt":"2021-03-01T21:23:40","slug":"webpack-imported-module-error-during-redux-fundamentals","status":"publish","type":"post","link":"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/","title":{"rendered":"Webpack Imported Module Error During Redux Fundamentals"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pngimage.net\/wp-content\/uploads\/2018\/06\/webpack-logo-png-5.png\" alt=\"React &amp; Webpack logos\" width=\"400\" height=\"200\"\/><\/figure><\/div>\n\n\n\n<p>There&#8217;s a great Redux Fundamentals course over on Pluralsight &#8211; but some (including myself) have probably encountered a frustrating error that doesn&#8217;t appear to happen in the course.  <\/p>\n\n\n\n<p>A webpack imported module error:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"163\" data-attachment-id=\"2868\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-5-9\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5.png\" data-orig-size=\"688,163\" 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-5\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5-300x71.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5.png\" alt=\"\" class=\"wp-image-2868\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5.png 688w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5-300x71.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-5-150x36.png 150w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0_react___default.a.createContext is not a function\n    at Object.&lt;anonymous&gt; (Context.js:4)\n    at Object.&lt;anonymous&gt; (bundle.js:704)\n    at __webpack_require__ (bootstrap b78e52de2bfadc5fd934:19)\n    at Object.&lt;anonymous&gt; (react-is.production.min.js:15)\n    at Object.&lt;anonymous&gt; (bundle.js:24683)\n    at __webpack_require__ (bootstrap b78e52de2bfadc5fd934:19)\n    at Object.&lt;anonymous&gt; (bundle.js:25227)\n    at __webpack_require__ (bootstrap b78e52de2bfadc5fd934:19)\n    at Object.&lt;anonymous&gt; (main.js:3)\n    at __webpack_require__ (bootstrap b78e52de2bfadc5fd934:19)<\/code><\/pre>\n\n\n\n<p>This results in a sad page when you run npm start:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"401\" data-attachment-id=\"2869\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-6-8\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6.png\" data-orig-size=\"890,401\" 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-6\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6-300x135.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6.png\" alt=\"\" class=\"wp-image-2869\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6.png 890w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6-300x135.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6-150x68.png 150w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-6-768x346.png 768w\" sizes=\"auto, (max-width: 890px) 100vw, 890px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>This is a known bug in the version of React (16.0.0) being used in the course. <\/p>\n\n\n\n<p>Updating React and React-Dom should resolve the error for you.  <\/p>\n\n\n\n<p>Head to package.json and you should find React and React DOM:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"252\" height=\"50\" data-attachment-id=\"2873\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-10-7\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10.png\" data-orig-size=\"252,50\" 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-10\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10.png\" alt=\"\" class=\"wp-image-2873\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10.png 252w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-10-150x30.png 150w\" sizes=\"auto, (max-width: 252px) 100vw, 252px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>    \"react\": \"16.0.0\",\n    \"react-dom\": \"16.0.0\",<\/code><\/pre>\n\n\n\n<p>Add a caret to the beginning of both of these dependencies to upgrade to the latest minor and patch versions:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"256\" height=\"53\" data-attachment-id=\"2874\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-11-7\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11.png\" data-orig-size=\"256,53\" 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-11\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11.png\" alt=\"\" class=\"wp-image-2874\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11.png 256w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-11-150x31.png 150w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>    \"react\": \"^16.0.0\",\n    \"react-dom\": \"^16.0.0\",<\/code><\/pre>\n\n\n\n<p>Now run the npm update command for these dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm update react react-dom<\/code><\/pre>\n\n\n\n<p>NPM will whirl away in the background and you&#8217;ll be updated to the latest minor and patch versions available.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \"react\": \"^16.13.1\",\n    \"react-dom\": \"^16.13.1\",<\/code><\/pre>\n\n\n\n<p>Currently these are 16.13.1, but I don&#8217;t anticipate any issues upgrading to further 16.x versions of both dependencies.  <\/p>\n\n\n\n<p>If you are encountering any issues, I have tested with the versions above and you can update your package.json to use these exact versions which will solve the problem:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    \"react\": \"16.13.1\",\n    \"react-dom\": \"16.13.1\",<\/code><\/pre>\n\n\n\n<p>Refresh now, and voil\u00e1!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"246\" data-attachment-id=\"2872\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-9-7\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9.png\" data-orig-size=\"534,246\" 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-9\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9-300x138.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9.png\" alt=\"\" class=\"wp-image-2872\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9.png 534w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9-300x138.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-9-150x69.png 150w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Still Not Working?  <\/h2>\n\n\n\n<p>After updating the React and React-Dom modules, if you see an error regarding module build failure such as this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"154\" data-attachment-id=\"2871\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2020\/04\/30\/webpack-imported-module-error-during-redux-fundamentals\/image-8-8\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8.png\" data-orig-size=\"579,154\" 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-8\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8-300x80.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8.png\" alt=\"\" class=\"wp-image-2871\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8.png 579w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8-300x80.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/image-8-150x40.png 150w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>utils.js:303 Uncaught Error: Module build failed: Error: ENOENT: no such file or directory, open 'C:\\ps-redux-funamentals\\node_modules\\react\\index.js'\n    at Object.&lt;anonymous&gt; (utils.js:303)\n    at __webpack_require__ (bootstrap e17faa0726616b7a89b0:19)\n    at Object.&lt;anonymous&gt; (main.js:1)\n    at __webpack_require__ (bootstrap e17faa0726616b7a89b0:19)\n    at Object.&lt;anonymous&gt; (harmony-module.js:24)\n    at __webpack_require__ (bootstrap e17faa0726616b7a89b0:19)\n    at bootstrap e17faa0726616b7a89b0:65\n    at bootstrap e17faa0726616b7a89b0:65<\/code><\/pre>\n\n\n\n<p>It&#8217;s likely you&#8217;ve not restarted after upgrading the modules.  Kill your current localhost server\/npm start command and retry npm start in the terminal window.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a great Redux Fundamentals course over on Pluralsight &#8211; but some (including myself) have probably encountered a frustrating error that doesn&#8217;t appear to happen in the course. A webpack imported module error: This&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2875,"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":"#Webpack Imported Module Error During #Redux Fundamentals\n\nFix by updating two #NPM modules!\n\n#DevelopmentIssues #React","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2139],"tags":[2695,2704,2720,2719,2717,2718],"class_list":["post-2867","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development-issues","tag-react","tag-react-issues","tag-react-webpack-module-error","tag-redux","tag-webpack","tag-webpack-imported-module-error"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2020\/04\/react-and-webpack-logos.png","jetpack_shortlink":"https:\/\/wp.me\/p3nsfA-Kf","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2867","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=2867"}],"version-history":[{"count":2,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2867\/revisions"}],"predecessor-version":[{"id":2994,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/2867\/revisions\/2994"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media\/2875"}],"wp:attachment":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media?parent=2867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/categories?post=2867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/tags?post=2867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}