Skip to content

TypeError: Cannot call method 'replace' of undefined #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garthk opened this issue Jun 7, 2013 · 7 comments · Fixed by #682
Closed

TypeError: Cannot call method 'replace' of undefined #168

garthk opened this issue Jun 7, 2013 · 7 comments · Fixed by #682

Comments

@garthk
Copy link

garthk commented Jun 7, 2013

Marked crashed and asked me to report the problem.

./node_modules/markdown-directory/node_modules/marked/lib/marked.js:1099
    throw e;
          ^
TypeError: Cannot call method 'replace' of undefined
Please report this to https://github.com/chjj/marked.
    at Lexer.lex (./node_modules/markdown-directory/node_modules/marked/lib/marked.js:130:6)
    at Function.Lexer.lex (./node_modules/markdown-directory/node_modules/marked/lib/marked.js:121:16)
    at marked (./node_modules/markdown-directory/node_modules/marked/lib/marked.js:1091:31)
    at ConcatStream.cb (./node_modules/markdown-directory/index.js:35:30)
    at ConcatStream.end (./node_modules/markdown-directory/node_modules/concat-stream/index.js:43:21)
    at ReadStream.onend (_stream_readable.js:483:10)
    at ReadStream.g (events.js:175:14)
    at ReadStream.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:910:16
    at process._tickDomainCallback (node.js:459:13)

I'm afraid I couldn't replicate the issue with text I can give you.

@TheDistractor
Copy link

Make sure you are not giving marked a 'Buffer'.

@welkang
Copy link

welkang commented Jul 4, 2013

Make sure that you give marked.parsemd(val) the val is not underfine.

@azhang
Copy link

azhang commented Jul 6, 2013

I'm also getting this when using with EpicEditor https://github.com/OscarGodson/EpicEditor

@whatevernot
Copy link

Hello: I have run into this issue when trying to use doxx.

I have a directory with one *.js source file and then I invoke doxx to output documentation:

% doxx --source ./ --target ./docs

which results in the stack trace below.

Version of node: 0.10.18
OS: Mac 10.8.5
doxx: 0.7.0
marked: 0.2.9

Any help is appreciated.

--- x8 snip

/usr/local/lib/node_modules/doxx/node_modules/marked/lib/marked.js:1099
throw e;
^
TypeError: Cannot call method 'replace' of undefined
Please report this to https://github.com/chjj/marked.
at Lexer.lex (/usr/local/lib/node_modules/doxx/node_modules/marked/lib/marked.js:130:6)
at Function.Lexer.lex (/usr/local/lib/node_modules/doxx/node_modules/marked/lib/marked.js:121:16)
at marked (/usr/local/lib/node_modules/doxx/node_modules/marked/lib/marked.js:1091:31)
at Object. (/usr/local/lib/node_modules/doxx/bin/doxx:116:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)

@albertmcw
Copy link

To whatevernot,

Just found your post which indicated a problem similar to mine. I have just solved it by putting a README.md file in the current directory and run doxx again. Hope that can help although it comes late.

@whatevernot
Copy link

Hi - thanks for the reply!

I recall somehow figuring it out a while back - I know it’s working now.

Appreciated - regards.

b…

On Mar 19, 2014, at 12:34 AM, albertmcw [email protected] wrote:

To whatevernot,

Just found your post which indicated a problem similar to mine. I have just solved it by putting a README.md file in the current directory and run doxx again. Hope that can help although it comes late.


Reply to this email directly or view it on GitHub.

@scottgonzalez
Copy link
Contributor

It sounds like everyone that has this problem is using some other tool which is using marked. Unless someone can provide a reduced test case, there's not much that can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants