Skip to content
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

Uncaught (in promise) TypeError: timer.unref is not a function #34

Open
matejmosko opened this issue Aug 9, 2017 · 3 comments
Open
Assignees
Labels

Comments

@matejmosko
Copy link

matejmosko commented Aug 9, 2017

npm v5.3.0
nodejs v8.2.1
electron v1.7.5

Hello, I was having some problems with your package and after solving some of them I still cannot use the package.
First on require('markpress') the system told me there is some version mismatch with onigurama package (it is indirect dependency of markpress). I have solved it using .npmrc file where I forced onigurama to install for specific electron version.

But it is not the main problem I am facing now. This is my code (data is any of your example md)

const options = {
     layout: 'horizontal',
     theme: 'light',
     autoSplit: true,
     allowHtml: false,
     verbose: false,
     title: 'Optional title for output HTML'
    };
    markpress(data, options).then(({html,md}) => {
      console.log(html);
    });
   }

Unfortunately I get this in console:

Uncaught (in promise) TypeError: timer.unref is not a function
at gcTimer (/home/gnaag/Programy/turban-player/node_modules/property-ttl/index.js:44:11)
at Grammar.get [as initialRule] (/home/gnaag/Programy/turban-player/node_modules/property-ttl/index.js:15:7)
at Grammar.module.exports.Grammar.getInitialRule (/home/gnaag/Programy/turban-player/node_modules/first-mate/lib/grammar.js:256:18)
at Grammar.module.exports.Grammar.tokenizeLine (/home/gnaag/Programy/turban-player/node_modules/first-mate/lib/grammar.js:119:28)
at Grammar.module.exports.Grammar.tokenizeLines (/home/gnaag/Programy/turban-player/node_modules/first-mate/lib/grammar.js:79:21)
at Highlights.module.exports.Highlights._highlightCommon (/home/gnaag/Programy/turban-player/node_modules/highlights/lib/highlights.js:187:28)
at Highlights.module.exports.Highlights.highlightSync (/home/gnaag/Programy/turban-player/node_modules/highlights/lib/highlights.js:41:19)
at Object.mdOptions.highlight (/home/gnaag/Programy/turban-player/node_modules/marky-markdown/lib/render.js:49:26)
at default_rules.fence (/home/gnaag/Programy/turban-player/node_modules/markdown-it/lib/renderer.js:50:27)
at md.renderer.rules.fence (/home/gnaag/Programy/turban-player/node_modules/markdown-it-expand-tabs/index.js:16:25)
at Object.md.renderer.rules.fence (/home/gnaag/Programy/turban-player/node_modules/marky-markdown/lib/code-wrap.js:8:18)
at Renderer.render (/home/gnaag/Programy/turban-player/node_modules/markdown-it/lib/renderer.js:326:38)
at MarkdownIt.render (/home/gnaag/Programy/turban-player/node_modules/markdown-it/lib/index.js:539:24)
at module.exports (/home/gnaag/Programy/turban-player/node_modules/marky-markdown/lib/render.js:66:32)
at module.exports (/home/gnaag/Programy/turban-player/node_modules/marky-markdown/index.js:39:10)
at createSlideHtml (/home/gnaag/Programy/turban-player/node_modules/markpress/index.js:77:5)
at prev.then.h0 (/home/gnaag/Programy/turban-player/node_modules/markpress/index.js:172:13)
at :null:null

@gamell
Copy link
Owner

gamell commented Aug 10, 2017

This might be caused by your overriding the oniguruma version, which first-mate uses. What is the original issue that you fixed?

@gamell gamell self-assigned this Aug 10, 2017
@matejmosko
Copy link
Author

Sorry for not being clear. First problem was with onigurama, that I solved by overriding the version with .npmrc. It is not my problem. I just mentioned it for you to know about it.

The second problem the issue is about is the problem with marky-markdown dependency property-ttl. I don't know where exactly is the problem But using your package property-ttl isn't allowed to use timer.unref (it is in the console.log above). The only way I have been able to run your plugin was manually delete the call for timer.unref from property-ttl.

I really don't know what are the shortages of my "solution". But it is not a desirable solution, while after every npm install I get the unmodified version of the module property-ttl.

@gamell
Copy link
Owner

gamell commented Aug 14, 2017

I've never seen that error before. It seems to be an error inside the highlights npm package (used by marky-markdown to highlight code blocks AFAIU). Could it be caused by the Markdown string you are passing as an input? I would try passing different (and simpler) strings to see if you can pinpoint what part of your input is causing the problem.

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

No branches or pull requests

2 participants