wordprismic
wordprismic copied to clipboard
Error - Unexpected end of JSON input
Config file
module.exports = {
wordpress: {
url: 'https://www.parcelhub.co.uk'
},
prismic: {
repo: 'parcelhubltd',
locale: 'en-gb',
categoriesType: ''
},
optimizeMediaRequests: false,
schema: async function(post, html) {
return {
type: 'post',
uid: post.slug,
title: html.decode(post.title.rendered),
content: await html.parse(post.content.rendered)
};
}
};
Output shown in CLI
> npx wordprismic -c .\wp-prismic-config.js
Downloading content
Fetching users...
Fetching posts...
Fetching page 2 of posts...
Fetching page 3 of posts...
Fetching categories...
Fetching media...
Fetching page 2 of media...
Fetching page 3 of media...
Fetching page 4 of media...
Fetching page 5 of media...
Fetching page 6 of media...
Fetching page 7 of media...
Fetching page 8 of media...
Fetching page 9 of media...
Fetching page 10 of media...
Fetching page 11 of media...
Fetching page 12 of media...
Fetching page 13 of media...
Fetching page 14 of media...
Fetching page 15 of media...
Fetching page 16 of media...
Fetching page 17 of media...
Fetching page 18 of media...
Fetching page 19 of media...
Fetching page 20 of media...
Parsing content
undefined:1
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at C:\Users\lee20\AppData\Roaming\npm-cache\_npx\35520\node_modules\wordprismic\lib\utils.js:76:22
at ChildProcess.exithandler (child_process.js:315:5)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe.<anonymous> (net.js:673:12)