Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting SyntaxError: Unexpected end of JSON input #133

Open
Gods-and-Monsters opened this issue Nov 29, 2021 · 2 comments
Open

Keep getting SyntaxError: Unexpected end of JSON input #133

Gods-and-Monsters opened this issue Nov 29, 2021 · 2 comments

Comments

@Gods-and-Monsters
Copy link

Gods-and-Monsters commented Nov 29, 2021

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
Copy link

jdcar commented Aug 1, 2022

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",

@cudevmaxwell
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants