Unexpected end of JSON input at Object.parse
Closed this issue · 9 comments
I receive the following message when trying to access primo after running the gulp run command
SyntaxError: Unexpected end of JSON input at Object.parse
I'm using primo ve and the proxy server is configured to point to our production url. No other changes have been made to the files. In the browser I see the primo "loading" graphic but nothing else.
Any help would be appreciated.
Thanks!
I've run into this problem, too.
In config.js, I've set the proxy to our VE server:
var PROXY_SERVER = 'https://sbctc-edcc.primo.exlibrisgroup.com:443';
Executed gulp with gulp run --view EDMONDS --ve
Server starts fine, but the second I resolve http://localhost:8003/discovery/?vid=EDMONDS
in Chrome or Firefox I get:
SyntaxError: Unexpected end of JSON input at Object.parse (native) at IncomingMessage.<anonymous> (C:\Users\daniel.moore\Documents\GitHub\edcc-primo\gulp\tasks\servers.js:56:53) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)
Disregard prior message - problem was that our Primo VE VID changed and I wasn't using it correctly.
I'm having the issue @dmoore describes above.
Our product Primo VE instance has views such as, vid=01TRI_INST:HC
https://tricolib.primo.exlibrisgroup.com/discovery/search?vid=01TRI_INST:HC&sortby=rank
How should I name my view in gulp to match up?
@th5, update your localhost URL with the new institution code 01TRI_INST:HC.
For us, updating the URL to http://localhost:8003/discovery/search?vid=01STATEWA_EDCC:EDMONDS&sortby=rank
stopped the error from occurring and let the view load normally.
Perhaps the README can be updated.
Currently it says:
- For Primo VE customers, add the --ve flag :
gulp run --view <the VIEW_CODE folder> --ve
- Open a browser and type in the following URL :
localhost:8003/primo-explore/?vid=your-view-code
(Example: http://localhost:8003/primo-explore/search?vid=Auto1) - For Primo VE customers open the following URL :
localhost:8003/discovery/?vid=your-view-code
I don't know if the non-Primo example is correct. However the example is misleading for VE users.
Also it wasn't clear to me that the local folder needs to match the name of one of your real views in your Primo instance.
My production Primo URLs contain vid's such as vid=01TRI_INST:HC
I should have:
- Named my local folder HC. When exporting what I currently had from Alma, the zip was named 01TRI_INST-HC so that is what I had tried.
- gulp run --view HC --ve
- Accessed by:
http://localhost:8003/discovery/?vid=01TRI_INST:HC
More generally:
- Local folder <view code>
gulp run --view <view code> --ve
- http://localhost:8003/discovery/?vid=<institution code>:<view code>