Select to view content in your preferred language

[webpack-cli] Failed to load 'client\webpack.config.js' config

14976
3
Jump to solution
07-28-2022 07:58 AM
bryc3w
by
New Contributor

Hi. We've built a custom ExB widget. I'm trying modify the setting component to take a URL from the user and store it the config.json file for the widget. I've done this once before and had no problem. I don't know what I did wrong this time, but I can no longer fire up the webpack using npm start.

It starts off saying...

> exb-client@1.8.0 start
> cross-env NODE_ENV=development webpack --mode development --watch

Then I get this error in ominous red text:

[webpack-cli] Failed to load 'D:\AGEB18\client\webpack.config.js' config
[webpack-cli] SyntaxError: Unexpected token / in JSON at position 590
at JSON.parse (<anonymous>)
at D:\AGEB18\client\webpack\webpack-extensions.common.js:373:29
at D:\AGEB18\client\webpack\webpack.common.js:457:11
at Array.forEach (<anonymous>)
at Object.visitFolder (D:\AGEB18\client\webpack\webpack.common.js:452:11)
at commonChecks (D:\AGEB18\client\webpack\webpack-extensions.common.js:366:17)
at Object.checkWidgets (D:\AGEB18\client\webpack\webpack-extensions.common.js:353:10)
at D:\AGEB18\client\webpack\webpack-extensions.config.js:18:56
at Array.forEach (<anonymous>)
at Object.<anonymous> (D:\AGEB18\client\webpack\webpack-extensions.config.js:9:26)

I tried looking at the files listed, but couldn't figure out what's going on. Anybody have any idea? Do I need to delete and reinstall the ExB files? I hope not! Thanks in advance for any insight you have to offer.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BryceWhiteside
New Contributor II

Problem solved. I found this helpful post in Stack Overflow: https://stackoverflow.com/questions/56920559/syntaxerror-unexpected-token-in-json-at-position-132. Turns out that what I did wrong was I commented out some lines in the manifest.json file, and you can't do that. That's what the "Unexpected token / in JSON at position 590" was all about (I commented those lines with two forward slashes - // - as you would do in JavaScript). I deleted those lines and now I'm back in action. Cheers.

View solution in original post

0 Kudos
3 Replies
BryceWhiteside
New Contributor II

Problem solved. I found this helpful post in Stack Overflow: https://stackoverflow.com/questions/56920559/syntaxerror-unexpected-token-in-json-at-position-132. Turns out that what I did wrong was I commented out some lines in the manifest.json file, and you can't do that. That's what the "Unexpected token / in JSON at position 590" was all about (I commented those lines with two forward slashes - // - as you would do in JavaScript). I deleted those lines and now I'm back in action. Cheers.

0 Kudos
FredericPoliart_EsriAU
Occasional Contributor II

I have just started having this exact same error today on my ExB Dev Edition V1.13 that has been running -fine- for months .. WHY

0 Kudos
FernandaBarth
Esri Contributor

Hello @FredericPoliart_EsriAU, I had a similar error and I found out that it was because for some reason the widgets-info.json file on client/dist/widgets was empty. I removed my custom widgets from dist and copied widgets-info.json file from a clean install. After that, it was running normally.

Hope it helps.

0 Kudos