Compiler 0.3.1 silently changes "\n" to "n" in string literals
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 70/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- node.js, typescript
- Bereich
- compilers
Rechercherichtung
Start by locating the string literal parsing and code generation entry points in the compiler, then reproduce with the provided repro.rx and compile.mjs example using @reactivescript/[email protected]. Check how the \n escape is represented through compilation; done means the generated separator evaluates to U+000A and the issue's reproduction no longer changes the split result.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
With @reactivescript/[email protected], compiling a newline separator changes its meaning without reporting a diagnostic.
Reproduction
Install the compiler in a Node.js project:
npm install --save-exact @reactivescript/[email protected]
Create repro.rx:
source text := ""
export default component Probe() {
lines = text.split("\n")
<pre>{lines.length}</pre>
}
Create compile.mjs and run node compile.mjs:
import { app } from "@reactivescript/compiler";
import { resolve } from "node:path";
const result = JSON.parse(app(resolve("repro.rx"), "dom"));
if (!result.modules) {
throw new Error(JSON.stringify(result));
}
for (const module of Object.values(result.modules)) {
console.log(module.code);
}
Actual output
The generated computation contains:
const v$lines = __rt.memo("lines", (__prev) => v$text()?.split("n"), undefined);
The separator is the letter n (U+006E), rather than a newline (U+000A). Compilation succeeds without reporting a diagnostic.
Expected behavior
The generated separator should evaluate to U+000A, preserving the semantics of .split("\n").
For example, given the JavaScript string "first\nsecond":
// Expected
["first", "second"]
// Actual with the generated separator
["first\nseco", "d"]
Impact
This caused incorrect rendering of single-line error summaries in an application. Diagnosing it required inspecting the generated JavaScript. Moving the string processing into an imported TypeScript helper worked around the issue.
Environment
@reactivescript/compiler:0.3.1- Target:
dom - Node.js:
v24.14.1 - Platform: macOS, arm64
Reproduced again on November 15, 2026. Confirmed for \n; other escape sequences have not been tested.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 127
- Forks
- 7
- Ø Merge
- 15 Std. 42 Min.
- Gemergte PRs (30 T.)
- 63
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus solidjs/reactivescript
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
solidjs/reactivescript#96 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Vite front end keeps serving a failed build after the missing/broken imported module is fixedEvtl. vergeben @cgaaf hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
solidjs/reactivescript#84 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
solidjs/reactivescript#77 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
solidjs/reactivescript#74 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 62/100
solidjs/reactivescript#97 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in solidjs/reactivescript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
GetStream/stream-chat-react#3467 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vercel-labs/ui#1139 ·
Maintainer antworten meist innerhalb von 1 Tag
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Evtl. vergeben @goranai hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
bot:ai-assisted component:platform-js status:untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
midnightntwrk/platform-js#93 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100