quarto-dev / quarto-dev/quarto
Wrong preview url used when `_quarto.yml` is present
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
Bug description
When _quarto.yml is present (even if empty) a wrong preview url is used even though the correct one is displayed after running quarto preview test.qmd. (I use the VSCode extension)
Possibly related: https://github.com/quarto-dev/quarto-cli/issues/6409
Steps to reproduce
Create an empty _quarto.yml and a test.qmd like
---
title: "Test"
---
# abc
and run quarto preview test.qmd.
When choosing either preview option (Editor / Browser) it tries to open the URL http://127.0.0.1:<port>/ while the preview command actually shows http://localhost:<port>/test.html as the correct URL.
Expected behavior
Use correct URL to preview
Actual behavior
Wrong URL is used to preview
Your environment
- IDE: VSCode Version: 1.91.0
- devcontainer on Macos running debian 12 (bookworm)
Quarto check output
# quarto check
Quarto 1.5.54
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.54
Path: /opt/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2024.07.03
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /root/.TinyTeX/bin/x86_64-linux
Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.12.4 (Conda)
Path: /opt/conda/bin/python
Jupyter: 5.7.2
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the preview URL handling used by quarto preview test.qmd and the VSCode Editor/Browser preview options, using the empty _quarto.yml reproduction. Compare the URL shown by the command with the URL opened by the extension; done means the preview opens http://localhost:<port>/test.html rather than the server root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100