backdrop-contrib / views_json

A Views handler that returns data as JSON objects.
https://backdropcms.org/project/views_json
GNU General Public License v2.0
1 stars 1 forks source link

There was an error accessing the API SyntaxError: #14

Closed keiserjb closed 1 year ago

keiserjb commented 1 year ago

I'm attempting to get json output and import to make a decoupled block and I get an error in the console.

When I preview the json inside the view it looks fine.

image

However when I then view the page the json is not closed.

image

I get the same thing in Postman.

image

Is this user error on my part or is there a problem with the output?

indigoxela commented 1 year ago

Is this user error on my part or is there a problem with the output?

It's an undesired result. :wink:

From current info it's impossible to guess, what happens. Can you provide steps to reproduce, please?

keiserjb commented 1 year ago

I tried to reproduce with a demo site from Backdropcms.org and it worked correctly with posts. I am seeing correct json in Postman. So things are pointing towards user error.

keiserjb commented 1 year ago

Still getting the error on a site with real content though. I created a display for posts that only shows the title and kept all of the default settings. The end of the json output gets chopped off.

indigoxela commented 1 year ago

Very strange. Even more, as the views preview seems to work in your dev environment.

Can you describe your environment? PHP version, web server, ... What have you tried so far to debug?

keiserjb commented 1 year ago

I first encountered the problem with my local Lando running php 7.4. I then tried it on my dev branch running in AWS. Same php 7.4 and had the same problem. I got the Headless module to work for me instead of this module.

indigoxela commented 1 year ago

Whatever works for you. :smiley: With the information I have and no steps to reproduce, I was running out of ideas, anyway.

Feel free to reopen, as soon as you have a clue, what went wrong.