Skip to content

Error page for direct access to package with code examples #89

Description

@jdebarochez

Hello!

Summary

Users can experience 500 errors when accessing via direct link packages (ie: https://replacements.fyi/is-number) which show display highlighted code examples. https://replacements.fyi/left-pad still works. Cloudflare Worker logs will provide better insights on why it's actually failing.

Steps to reproduce

  1. Navigate to https://replacements.fyi/is-number
  2. Experience a 500 error
Image

Investigation

Going to the search for is-number, the link still works. https://replacements.fyi/left-pad still works too. I believe the failure is strongly correlated with the SSR highlighter invocation in the Worker for simple packages with examples:

{:else if data.type === 'simple'}
  {#if data.example}
    {@html await highlight(data.example)}
  {/if}

Native, documented, and removal replacements do not use that branch, so they avoid the failing SSR operation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions