Home › Forums › ACF PRO › json import error: "import file empty" › Reply To: json import error: "import file empty"
For me, the problem was that the JSON file that I was trying to import had a comma where there wasn’t suppose to be. Specifically it was on the last line of the location array. Here’s an example, notice here that there is a comma at the end of the “value” line:
"location": [
[
{
"param": "post_template",
"operator": "==",
"value": "components\/logo-heading-cta.php",
}
]
],
When I removed that comma, like this:
"location": [
[
{
"param": "post_template",
"operator": "==",
"value": "components\/logo-heading-cta.php"
}
]
],
Then the JSON file imported without any problem. I noticed this because my text editor showed that the comma there was a syntax error. It seems JSON is specific about not having a comma after the last item in an array.
Maybe this will be the solution for anyone else trying to find an answer to this problem.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.