Skip to content

Quarto render / preview immediately reports "SyntaxError: Unexpected end of JSON input" #6392

@pranavmishra90

Description

@pranavmishra90

Bug description

Hi all,

I've been using quarto successfully for some time now. On my main machine, I can't seem to perform any quarto render or quarto preview commands. Using VSCode's quarto plugin produces the same error. I also have quarto installed inside of a docker container which produces an error, though a different one.

Do not know why a previously functioning quarto is no longer working (details below)

Steps to reproduce

My directory consists of a Git repository with several submodules. The parent / root directory contains a _quarto.yml file with the following contents

project:
  type: website
  output-dir: ./notebook/_site
  render:
    - "*.qmd"
    - "*.md"
    - "*.ipynb"
  preview:
    port: 3333
    browser: true
    watch-inputs: true
    timeout: 300

bibliography:
  - ./notebook/references.bib
csl: ./notebook/ama.csl

citation: false
google-scholar: true

website:
  title: "redacted Project"
  navbar:
    left:
      - href: index.qmd
        text: Home
      - href: https://github.com/redacted
        text: GitHub
      - href: notebook/external/redacted
    search: true
  open-graph: true
  sidebar:
    style: "docked"
    contents: auto
    repo-url: https://github.com/redacted
    repo-actions: [issue, edit]
  reader-mode: true
  repo-url: https://github.com/redacted
  repo-actions: [issue, edit]
  page-footer: "redacted"

format:
  html:
    theme:
      light: flatly
      dark: darkly
    toc: true
    lang: en-US
    email-obfuscation: javascript
    code-fold: true
    code-line-numbers: true
    code-overflow: wrap
    grid:
      sidebar-width: 350px
    default-image-extension: svg

  # pdf:
  #   # pdf-engine: latexmk
  #   documentclass: scrartcl
  #   toc: true
  #   code-fold: true
  #   papersize: letter
  # #   toc-depth: 2
  # #   lof: true
  # #   lot: true
  #   margin-left: 30mm
  #   margin-right: 30mm
  #   highlight-style: github
  #   colorlinks: true
  #   default-image-extension: png  


execute:
  freeze: auto
  cache: true
  error: true

I use quarto to build a static website, which is rendered in ./notebook/_site.

Command

quarto render

Expected behavior

Begin rendering the website by going into the subdirectories and rendering .ipynb, .qmd, etc.

Output to notebook/_site/

Actual behavior

Debian

(scRNAseq) pranav@singulab prrx1 (main) : quarto render
ERROR: SyntaxError: Unexpected end of JSON input

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.target (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:55201:27)
    at fileExecutionEngineAndTarget (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:58033:33)
    at renderContexts (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:82635:40)
    at Object.renderFormats (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:82688:32)
    at inputTargetIndex (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:83504:35)
    at entryFromHref (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:92762:25)
    at nodesToEntries (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:92733:36)
    at async nodesToEntries (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:92729:35)
    at async nodesToEntries (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:92729:35)

I also get a similar same output when trying quarto preview

(scRNAseq) pranav@singulab prrx1 (main) : quarto preview
Preparing to preview
ERROR: SyntaxError: Unexpected end of JSON input

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.target (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:55201:27)
    at fileExecutionEngineAndTarget (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:58033:33)
    at renderContexts (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:82635:40)
    at Object.renderFormats (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:82688:32)
    at inputTargetIndex (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:83504:35)
    at resolveInputTarget (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:83583:25)
    at serveFiles (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:103550:30)
    at async serveProject (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:103188:30)
    at async Command.fn (file:///home/pranav/opt/quarto-1.3.433/bin/quarto.js:103749:13)

Docker

root@f00ca38999ac:/home/rstudio/work# quarto render
ERROR: Include directive needs filename as a parameter

VSCode

Produces the same error as listed under 'Debian'.

Your environment

OS: Debian 12
IDE: VSCode 1.80.2
Quarto: 1.3.433

Quarto check output

As a sanity check, I even uninstalled and reinstalled quarto

(scRNAseq) pranav@singulab prrx1 (main) : quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.433
      Path: /home/pranav/opt/quarto-1.3.433/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.12 (Conda)
      Path: /home/pranav/mambaforge/envs/scRNAseq/bin/python
      Jupyter: 5.3.1
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /home/pranav/mambaforge/envs/scRNAseq/lib/R
      LibPaths:
        - /home/pranav/mambaforge/envs/scRNAseq/lib/R/library
      knitr: (None)
      rmarkdown: (None)

      The rmarkdown package is not available in this R installation.
      Install with install.packages("rmarkdown")

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions