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

perfStart and perfStop breaking code in the browser #36

Closed
taylorhadden opened this issue May 19, 2022 · 6 comments · Fixed by #39
Closed

perfStart and perfStop breaking code in the browser #36

taylorhadden opened this issue May 19, 2022 · 6 comments · Fixed by #39

Comments

@taylorhadden
Copy link

The usage of process.env.LOG_PERF on lines 214 and 218 of utilities.ts is causing an exception when translate() is called within the browser.

I have had luck using the following patten to make code work across node and browser contexts:

if (typeof global === 'undefined') {
    // Browser code
}
else {
    // Node code
}

I can create a PR to add this. Is this desirable?

@hrishikesh-k
Copy link

hrishikesh-k commented Jun 19, 2022

I'm having the same issue. At first I thought this is not compatible with browsers (because even the name sid node), but checked readme and it says it's supported in browsers.

I'd personally think, having console.time() is not required in browser builds. It should be only used for testing and benchmarking purposes.

Unfortunately, this was the only library perfece for my needs as it allowed easy customization for the Markdown output. Sadly, it seems this PR will take time. :(

@SettingDust
Copy link
Contributor

SettingDust commented Jul 1, 2022

Should removed by https://github.com/crosstype/node-html-markdown/blob/master/transformer.js. Maybe not working

Edit: Only removed the invoke

@SettingDust
Copy link
Contributor

For now can use "node-html-markdown": "https://github.com/SettingDust/node-html-markdown"

@nonara
Copy link
Collaborator

nonara commented Oct 25, 2022

Very sorry for the delay on this! My backlog was overloaded and I didn't catch this. Thanks @SettingDust for the PR.

Merged

@thomasefbland
Copy link

This error is still in the code and still persists

@josiah-roberts
Copy link

+1, still broken.

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.

6 participants