Skip to content

Content Fetch Broken ; Issue with JSON Parsing #40

@ltrademark

Description

@ltrademark

Error Output:

undefined:1

[Base64 string that resolves into an image from the Notion page. this base64 string does start with "R" but its valid.]
^

SyntaxError: Unexpected token R in JSON at position 0

    at JSON.parse (<anonymous>)
    at IncomingMessage.<anonymous> (/rbd/pnpm-volume/5cc784b6-0d5a-4458-b4c1-1c03663539f5/node_modules/notion-page-to-html/dist/utils/use-cases/http-get/node-http-get.js:74:44)
    at IncomingMessage.emit (node:events:538:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Location:

Explanation & Reproduction:

This error happens when I try to run await NotionPageToHtml.convert(); to fetch data. It seems to happen regardless of including any of the { title, icon, cover, html } values; omitting some, or only using one of those values gave me the same result. Whats strange is that it was working before without issue, and it had suddenly stopped working. This potentially could be a change Notion made that is breaking the way this package runs/renders content from Notion.

As for Reproducing this error, all I did was call a const { title, icon, cover, html } = await NotionPageToHtml.convert([Notion page URL with ID]), and placing console logs before and after this line. Only the log before is triggered, then the error happens and the code exits immediately.

I can try rebuilding node-modules just in case its a node issue, but i see very little resolve in finding a solution of my projects end. If anyone else is having a similar issue, it would be of great help to hear how you may have resolved said issue~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions