-
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
TypeError: this.buffer.substring is not a function
at Lexer.getLine (/usr/src/app/node_modules/yaml/dist/parse/lexer.js:208:28)
at Lexer.parseStream (/usr/src/app/node_modules/yaml/dist/parse/lexer.js:244:25)
at parseStream.next (<anonymous>)
at Lexer.parseNext (/usr/src/app/node_modules/yaml/dist/parse/lexer.js:226:36)
at parseNext.next (<anonymous>)
at Lexer.lex (/usr/src/app/node_modules/yaml/dist/parse/lexer.js:160:32)
at lex.next (<anonymous>)
at Parser.parse (/usr/src/app/node_modules/yaml/dist/parse/parser.js:159:20)
at parse.next (<anonymous>)
at Composer.compose (/usr/src/app/node_modules/yaml/dist/compose/composer.js:130:20)
To Reproduce
test.js
import YAML from 'yaml';
import * as fs from "fs/promises";
try {
const file = await fs.readFile("config.yml");
let config = YAML.parse(file);
} catch (e) {
console.error(e);
}config.yml
test:
data:
- foo
- barExpected behaviour
I expected config.yml to be loaded and parsed to a JS object without error.
Versions:
- Environment: Node.js 16 (Docker Image)
yaml: 2.2.1
Additional context
Add any other context about the problem here.
NotoriousPyro and dfredell
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working