[error] HookWebpackError: Unexpected token / in JSON at position 0
at makeWebpackError (C:\Users\AK\Desktop\app\cc\node_modules\webpack\lib\HookWebpackError.js:48:9)
at C:\Users\AK\Desktop\app\cc\node_modules\webpack\lib\Compilation.js:3060:12
at eval (eval at create (C:\Users\AK\Desktop\app\cc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:44:1)
at fn (C:\Users\AK\Desktop\app\cc\node_modules\webpack\lib\Compilation.js:480:17)
at _next2 (eval at create (C:\Users\AK\Desktop\app\cc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:41:1)
at eval (eval at create (C:\Users\AK\Desktop\app\cc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:60:1)
-- inner error --
SyntaxError: Unexpected token / in JSON at position 0
at JSON.parse (<anonymous>)
at C:\Users\AK\Desktop\app\cc\node_modules\@angular-devkit\build-angular\src\webpack\plugins\devtools-ignore-plugin.js:42:38
at fn (C:\Users\AK\Desktop\app\cc\node_modules\webpack\lib\Compilation.js:478:10)
at _next2 (eval at create (C:\Users\AK\Desktop\app\cc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:41:1)
at eval (eval at create (C:\Users\AK\Desktop\app\cc\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:60:1)
Unexpected token / in JSON at position 0 at makeWebpackError
Share
The wording of the error message corresponds to what you get from Google Chrome when you run
JSON.parse('<...')
. I know you said the server is settingContent-Type:application/json
, but I am led to believe the response body is actually HTML.The
err
was actually thrown withinjQuery
, and passed to you as a variableerr
. The reason that line is underlined is simply because that is where you are logging it.I would suggest that you add to your logging. Looking at the actual
xhr
(XMLHttpRequest) properties to learn more about the response. Try addingconsole.warn(xhr.responseText)
and you will most likely see the HTML that is being received.