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.

Error when compiling a language that requires another language

See original GitHub issue

How to reproduce Create a language testa.js

/*
Language: testa
Requires: testb
*/

export default function(hljs) {
  return {
    name: 'testa'
  };
}

that requires a language testb.js

/*
Language: testb
*/

export default function(hljs) {
  return {
    name: 'testb'
  };
}

Then compile testa

node .\tools\build.js -n testa

You will receive the following messages on the terminal:

Starting build.
Finished build.
... testa requires testb
(node:3900) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'requires' of undefined
    at filter (D:\Projekte\highlight.js_parser\highlight.js\tools\lib\dependencies.js:74:10)
    at Object.buildBrowser [as build] (D:\Projekte\highlight.js_parser\highlight.js\tools\build_browser.js:25:15)
    at async doTarget (D:\Projekte\highlight.js_parser\highlight.js\tools\build.js:87:3)
(node:3900) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3900) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Trying to use the languages in tools/developer.html shows that the compilation indeed did not succeed.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Oct 7, 2020

Adding \r? to those regex solves the problem for me.

Stupid line endings. Can you make a PR? 😃

1reaction
joshgoebelcommented, Oct 6, 2020

Can anyone else reproduce this? @allejo @egor-rogov Either of you on windows?

Read more comments on GitHub >

github_iconTop Results From Across the Web

configure error "A compiler with support for C++11 language ...
no configure: error: *** A compiler with support for C++11 language features is required. Here is the output from g++ --version : g++...
Read more >
The 7 Most Common Types of Errors in Programming and ...
Experiencing different types of errors in programming is a huge part of the ... Some programming languages require a compilation step.
Read more >
Interpreted vs Compiled Programming Languages: What's the ...
Compiled languages need a “build” step – they need to be manually compiled first. You need to “rebuild” the program every time you...
Read more >
Configuring your compiler: Choosing a language standard
With Visual Studio, you will need to reselect your language standard every time you create a new project. To select a language standard,...
Read more >
Difference between Compiled and Interpreted Language
A compiled language is a programming language that is generally ... 5, In this language, compilation errors prevent the code from compiling.
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