Skip to content

Unparseable Color String Causes Disqus Comments to Fail in Next.js Project #158

@animanoir

Description

@animanoir

Bug Report

Describe the bug

The bug occurs when the parseColor function attempts to parse an unparseable color string in the format oklch(0.9850.002247.839). This results in an error that prevents Disqus comments from appearing in the Next.js project.

To Reproduce

  1. Navigate to the page with Disqus comments: Go to the page where Disqus comments are supposed to be displayed.
  2. Trigger the color parsing: The error occurs when the parseColor function is called, likely during the rendering of the Disqus comments section.
  3. Observe the error: The error message indicates that the color string is unparseable, causing the Disqus comments to fail to load.

Expected behavior

The expected behavior is for the parseColor function to correctly parse the color string or handle it gracefully if it is invalid, allowing Disqus comments to load without errors.

Specifications:

  • OS: Windows 11
  • Package version: Next.js version 15.1.7
  • Node version: v22.13.1

Additional context

The error seems to stem from an incorrectly formatted oklch color string. The oklch function expects values for lightness (l), chroma (c), and hue (h), typically separated by spaces. The provided string lacks proper spacing between the values, which might be causing the parsing issue. The correct format should be oklch(l c h / a), where l, c, and h are separated by spaces and a is the optional alpha channel value. I'm not using Daisy.

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