Marked: TypeError: src.replace is not a function

Created on 10 Mar 2017  路  1Comment  路  Source: markedjs/marked

TypeError: src.replace is not a function
Please report this to https://github.com/chjj/marked.
at Lexer.lex (E:\myGit\node-blog\node_modules\marked\lib\marked.js:138:6)
at Function.Lexer.lex (E:\myGit\node-blog\node_modules\marked\lib\marked.js:129:16)
at marked (E:\myGit\node-blog\node_modules\marked\lib\marked.js:1219:31)
at E:\myGit\node-blog\routes\posts.js:141:16
at newTickHandler (E:\myGit\node-blog\node_modules\mpromise\lib\promise.js:234:18)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

L2 - annoying help wanted

Most helpful comment

For me the error was that I used

let content = fs.readFileSync('./readme.md')

instead of

let content = fs.readFileSync('./readme.md', 'utf-8')

>All comments

For me the error was that I used

let content = fs.readFileSync('./readme.md')

instead of

let content = fs.readFileSync('./readme.md', 'utf-8')
Was this page helpful?
0 / 5 - 0 ratings