Fixing webpack/npm error: ERROR in TokContext is not defined

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]
    [1] (webpack)-hot-middleware/client-overlay.js 1.01 kB {0} [built]
    [2] (webpack)-hot-middleware/client.js?path=/__webpack_hmr&timeout=20000 3.43 kB {0} [built]
    [3] (webpack)-hot-middleware/~/querystring/decode.js 2.4 kB {0} [built]
    [4] (webpack)-hot-middleware/~/querystring/encode.js 2.09 kB {0} [built]
    [5] (webpack)-hot-middleware/~/querystring/index.js 127 bytes {0} [built]
    [6] (webpack)-hot-middleware/~/strip-ansi/index.js 161 bytes {0} [built]
    [7] (webpack)-hot-middleware/~/strip-ansi/~/ansi-regex/index.js 135 bytes {0} [built]
    [8] (webpack)-hot-middleware/process-update.js 3.27 kB {0} [built]
    [9] (webpack)/buildin/module.js 251 bytes {0} [built]

ERROR in TokContext is not defined

This seems to be called by doing this:

require("node-jsx").install();

Instead of this:

require("node-jsx").install({extension: '.jsx'});

Leave a Reply

Your email address will not be published. Required fields are marked *