{"id":3610,"date":"2016-04-08T12:46:45","date_gmt":"2016-04-08T12:46:45","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=3610"},"modified":"2016-04-08T12:46:45","modified_gmt":"2016-04-08T12:46:45","slug":"fixing-webpacknpm-error","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/fixing-webpacknpm-error\/","title":{"rendered":"Fixing webpack\/npm error: ERROR in TokContext is not defined"},"content":{"rendered":"<p>If you try to make node use JSX, you can get the following error in Webpack:<\/p>\n<pre lang=\"javascript\">\nHash: 86248b395e54ade3d3cc\nVersion: webpack 1.12.14\nTime: 1538ms\n        Asset     Size  Chunks       Chunk Names\n    bundle.js  36.1 kB       0       main\nbundle.js.map  40.8 kB       0       main\nchunk    {0} bundle.js, bundle.js.map (main) 12.9 kB [rendered]\n    [0] multi main 40 bytes {0} [built] [1 error]\n    [1] (webpack)-hot-middleware\/client-overlay.js 1.01 kB {0} [built]\n    [2] (webpack)-hot-middleware\/client.js?path=\/__webpack_hmr&timeout=20000 3.43 kB {0} [built]\n    [3] (webpack)-hot-middleware\/~\/querystring\/decode.js 2.4 kB {0} [built]\n    [4] (webpack)-hot-middleware\/~\/querystring\/encode.js 2.09 kB {0} [built]\n    [5] (webpack)-hot-middleware\/~\/querystring\/index.js 127 bytes {0} [built]\n    [6] (webpack)-hot-middleware\/~\/strip-ansi\/index.js 161 bytes {0} [built]\n    [7] (webpack)-hot-middleware\/~\/strip-ansi\/~\/ansi-regex\/index.js 135 bytes {0} [built]\n    [8] (webpack)-hot-middleware\/process-update.js 3.27 kB {0} [built]\n    [9] (webpack)\/buildin\/module.js 251 bytes {0} [built]\n\nERROR in TokContext is not defined\n<\/pre>\n<p>This seems to be called by doing this:<\/p>\n<pre lang=\"javascript\">\nrequire(\"node-jsx\").install();\n<\/pre>\n<p>Instead of this:<\/p>\n<pre lang=\"javascript\">\nrequire(\"node-jsx\").install({extension: '.jsx'});\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you try to make node use JSX, you can get the following error in Webpack: Hash: 86248b395e54ade3d3cc Version: webpack 1.12.14 Time: 1538ms Asset Size Chunks Chunk Names bundle.js 36.1 kB 0 main bundle.js.map 40.8 kB 0 main chunk {0} bundle.js, bundle.js.map (main) 12.9 kB [rendered] [0] multi main 40 bytes {0} [built] [1 error] &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/fixing-webpacknpm-error\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing webpack\/npm error: ERROR in TokContext is not defined&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[302,324,387,455,592],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3610"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=3610"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/3610\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=3610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=3610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=3610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}