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

Cannot load extra languages on 11.3.0 #3363

Closed
JoshyPHP opened this issue Oct 17, 2021 · 2 comments
Closed

Cannot load extra languages on 11.3.0 #3363

JoshyPHP opened this issue Oct 17, 2021 · 2 comments
Labels
bug help welcome Could use help from community parser

Comments

@JoshyPHP
Copy link

JoshyPHP commented Oct 17, 2021

I'm trying out 11.3.0 and it seems impossible to load any extra language. Here's my full test page, complete with all of the boilerplate code:

<!DOCTYPE html>
<html lang="en">
<head>
	<title>hljs</title>
	<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.3.0/build/styles/default.min.css">
	<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.3.0/build/highlight.min.js"></script>
	<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.3.0/build/languages/erlang.min.js"></script>
</head>
<body>
	<pre><code class="language-erlang">-module(hello).
-export([hello_world/0]).

hello_world() -> io:fwrite("hello, world\n").</code></pre>
<script>hljs.highlightAll();</script>
</body>
</html>

Here's the error I get in Chromium's console: (the same error is triggered on Firefox)

Uncaught TypeError: Cannot assign to read only property 'name' of function 'e=>{
const n="[a-z'][a-zA-Z0-9_']*",r="("+n+":"+n+"|"+n+")",a={
keyword:"after and andalso|10 band begin bnot b...<omitted>...}}'
    at Object.registerLanguage (highlight.min.js:290)
    at erlang.min.js:1

As far as I can tell, this is because the closure passed to registerLanguage in order to register new languages currently returns another closure whereas registerLanguage expects an object with a name property. This happens with erlang and smalltalk but I suppose it's the same thing for all the languages. I've only tried the files hosted on CDN, not sure whether it makes a difference.

@JoshyPHP JoshyPHP added bug help welcome Could use help from community parser labels Oct 17, 2021
@joshgoebel
Copy link
Member

Confirm the output of Rollup changed and that broke our CDN build for individual grammars. Looking into this now.

@joshgoebel
Copy link
Member

In stable-11 and 11.3.1 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community parser
Projects
None yet
Development

No branches or pull requests

2 participants