Skip to content

Regression Node 24.0.0+: JSON.parse throws error on JSON containing U+2028 (line separator)/ U+2029 (paragraph separator) #60606

@DAsfLeanIX

Description

@DAsfLeanIX

Version

node v24.0.0+

What steps will reproduce the bug?

  • Open a Node.js shell session (version 24.x or later).
  • Run JSON.parse('{"text":"Hello
World"}') (The character between “Hello” and “World” is U+2028 (line separator). You can also use U+2029 (paragraph separator) instead.)

which will return with a Uncaught SyntaxError: Unexpected token ...

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

Summary

Note: V8's "Subsume JSON" documentation explicitly discusses making these code points processable in JavaScript string literals (https://v8.dev/features/subsume-json). Given that, this change is surprising and breaks existing production pipelines.

What do you see instead?

After upgrading to Node v24.x, JSON.parse() now throws a SyntaxError when parsing JSON text that contains literal U+2028 (line separator) or U+2029 (paragraph separator) inside a string value. The same input parsed successfully on Node v23.x. This looks like a regression or at least an undocumented behaviour change in Node/V8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions