ExLibrisGroup/primo-explore-devenv

Keep getting SyntaxError: Unexpected end of JSON input

Opened this issue · 2 comments

Hello everyone,

I'm starting to get depressed with Primo VE. I've been trying to update the CSS for weeks now, but every time I try to launch BrowserSync, I first get the loading page of Primo with nothing happening and if I try to refresh the page, I get the following message on my Terminal:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (/Users/jeremierudaz/Documents/CoordRVN/PrimoVE/primo-explore-devenv/gulp/tasks/08-servers.js:59:53)
    at IncomingMessage.emit (events.js:194:15)
    at IncomingMessage.EventEmitter.emit (domain.js:459:23)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

I carefully followed every step, installing Node, npm and gulp. I made sure to complete the Gulp configuration file with the correct Primo front-end URL. I also triple check that I was using the correct URL to access Primo locally.
I even tried to reinstall everything at least 3 times. But it still doesn't work.

I had a few warning messages when I followed the step 7 and when the installation was over, the following was displayed on my Terminal:

found 65 vulnerabilities (36 moderate, 26 high, 3 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

I tried to run npm audit fix and even npm audit fix --force but there's always vulnarabilities and I have no clue how to fix them.

Do you think it's related to my problem?

It worked well a few months ago, but now I always have the SyntaxError message and I just don't know what to do.

Can you please help me? I really have to update our CSS.

FYI I also checked the closed issues related to the SyntaxError, and nothing worked for me.

Thank you very much!

jdcar commented

I was having this issue. It turned out I was pointing to Primo sandbox instead of production. My sandbox view was deleted during a sb refresh so I just changed it to point to a production view: I had to fix the link in config.js: var PROXY_SERVER =[insert your institutions primo link here]

I used the devenv the first time since Nov 2021 today and I was having issues with importing node modules. I fixed this by going into package.json and updating gulp-sass to the newest version: "gulp-sass": "5.1.0",

I was experiencing this as well. I noticed that the HTTP request which caused the error was:

http://localhost:8003/primaws/rest/pub/configuration/vid/null

By adding the vid parameter to the development URL, the error went away. So check that your development URL looks like:

http://localhost:8003/discovery/search?vid=INST:DEFAULT

For example, our Primo uses this url:

https://ocul-crl.primo.exlibrisgroup.com/discovery/search?vid=01OCUL_CRL:CRL_DEFAULT

so when I'm working on the customization package, I fire up gulp run --view 01OCUL_CRL-CRL_DEFAULT --ve --browserify and visit

http://localhost:8003/discovery/search?vid=01OCUL_CRL:CRL_DEFAULT