(Twoslash) Compilation errors are silent and cause entire file to fail to render

Open
#49 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
build-system

Research direction

Reproduce the failure from src/content/blog/example.md using bun i, bun run dev, and bun run build, following the linked reproduction steps. Trace how Twoslash compilation errors are handled during rendering and building. Done means compilation errors produce a useful error message and prevent a successful build instead of leaving the page and output blank.

Written by the indexing model from the issue text.

Description

bug question twoslash

Thank you for making this package- it is super useful

However I find it really hard to use as if there is any sort of compilation error, nothing is logged out and the entire page I'm working on immediately goes blank

I would except some kind of error message to help debug the issue, as well as for this to prevent builds from successfully completing

Reproduction Steps

  1. Clone https://github.com/ethanniser/ec-twoslash-issue-repro.git
  2. Run bun i then bun run dev
  3. Go to http://localhost:4321/blog/example/
  4. Observe twoslash working
  5. Uncomment commented lines in src/content/blog/example.md
  6. Observe whole page go blank
  7. Run bun run build
  8. Observe build succeed without error
  9. Look at dist and see that build output is also blank (like dev)
Dominant language
TypeScript
Stars
31
Forks
8
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from withstudiocms/expressive-code-twoslash

All issues in withstudiocms/expressive-code-twoslash

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.