ITADN

parsing json via import() fails for escaped characters

#1470OpenSteelhasher 创建于 2026-03-26
S
Steelhashercommented
### Description Parsing JSON via `await import()` fails for escaped characters like `\"`. ### Steps to reproduce 1. Create a file test.json with this content: `["\"Test"]` 2. Run llrt in the same directory as the test json file e.g. `.\llrt.exe` 3. Run `await import("./test.json")` ### Expected Behavior The JSON is parsed correctly as `{ default: [ '"Test' ] }` ### Current Behavior Parsing fails with error: `Error: "[""Test"] " not valid JSON at index 0` ### Context Nodejs parses the same json test file correctly using the with type json attribute. `node` `await import("./test.json",{with: {type: "json"}})` `{ default: [ '"Test' ] } `
0 条评论