question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning for missing `console` syntax

See original GitHub issue

Following this https://gitter.im/MoOx/phenomic?at=57b6202998125cfb657bc8d7

I am getting this warning.

Warning: %s Module build failed: Error: Expected `console` to be registered
    at coreHighlight (/Users/moox/Sync/Development/phenomic/node_modules/lowlight/lib/core.js:354:15)
    at Object.highlight (/Users/moox/Sync/Development/phenomic/node_modules/lowlight/lib/core.js:898:22)
    at visitor (/Users/moox/Sync/Development/phenomic/node_modules/remark-highlight.js/dist/index.js:36:45)
    at one (/Users/moox/Sync/Development/phenomic/node_modules/unist-util-visit/index.js:72:22)
    at all (/Users/moox/Sync/Development/phenomic/node_modules/unist-util-visit/index.js:48:26)
    at one (/Users/moox/Sync/Development/phenomic/node_modules/unist-util-visit/index.js:76:20)
    at visit (/Users/moox/Sync/Development/phenomic/node_modules/unist-util-visit/index.js:82:5)
    at /Users/moox/Sync/Development/phenomic/node_modules/remark-highlight.js/dist/index.js:42:45
    at wrapped (/Users/moox/Sync/Development/phenomic/node_modules/trough/index.js:128:19)
    at next (/Users/moox/Sync/Development/phenomic/node_modules/trough/index.js:81:24)

As you mentionned on the chat, this is likely due to “console” not being recognized. Ref https://github.com/isagalaev/highlight.js/issues/1126 (as it’s not in highlight.js as well for now).

I think one improvement is to make the warning message more clear. Something like

Lowlight expects "console" syntax language to be registered. Code can be highlighted with the appropriate syntax.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ben-ebcommented, Aug 19, 2016

remark-highlight.js 4.0.1 is out with this fix.

0reactions
MoOxcommented, Aug 19, 2016

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-console - ESLint - Pluggable JavaScript Linter
This rule disallows calls or assignments to methods of the console object. Examples of incorrect code for this rule: /* eslint no-console: "error"...
Read more >
SyntaxError: missing ) after argument list - JavaScript | MDN
The JavaScript exception "missing ) after argument list" occurs when there is an error with how a function is called. This might be...
Read more >
Hide errors and warnings from console - javascript
A dirty way to hide all Javascript console warnings is by overriding the console object's warn method: console.warn = () => {};.
Read more >
Lint warnings about "Unexpected console statement no-console"
Current behavior: When I run yarn test in this project, it shows 25 lint warnings, all apparently complaining that console shouldn't be used ......
Read more >
Problem with SP.PanoramicScreenshot via blueprint node ...
Problem with SP.PanoramicScreenshot via blueprint node "Execute Console Command" gives me warning: LogStereoPanorama: Warning: Missing GameMode ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found