• I encountered an error when I tried to set up scrapbox-duplicator on Heroku again.
  • The error message is:
Exporting a json file from "/blu3mo"...
error: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
  const { pages } = (await res.json()) as ExportResponse;
                     ^
    at JSON.parse (<anonymous>)
    at packageData (deno:op_crates/fetch/22_body.js:247:21)
    at Response.json (deno:op_crates/fetch/22_body.js:192:18)
    at async exportJSON (file:///app/index.ts:39:22)
    at async file:///app/index.ts:79:17
  • I found a possible solution to this error on this Microsoft forum. It suggests that this error occurs when the web API returns an HTML error page instead of the expected JSON response.
  • I initially thought it could be a configuration error with Scrapbox SID, but it seems to be something else.
  • I will investigate further.