RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

rapidoc-min.js contains syntax errors

Open Shryne opened this issue 3 years ago • 1 comments

I have an application that uses rapidoc-min.js from https://unpkg.com/rapidoc/dist/rapidoc-min.js. Version 9.2.0 worked fine but 9.3.2 and 9.3.3 result in an empty page.

According to Firefox the error seems to be this:

Uncaught SyntaxError: expected expression, got ')' (2, 9012)

Here is the code:

for (const t of n.getAttributeNames()) if (t.endsWith("$lit$") || t.startsWith(w)) {
    const r = c[o++];
    if (e.push(t), void 0 !== r) {
        const e = n.getAttributer.toLowerCase() + "$lit$"
    ). // here is the bug. The bracket is wrong
        split(w), t = /([.?@])?(.*)/.exec(r);
        s.push({
            type: 1,
            index: a,
            name: t[2],
            strings: e,
            ctor: "." === t[1] ? K : "?" === t[1] ? Y : "@" === t[1] ? Z : G
        })
    } else s.push({type: 6, index: a})
}

However, fixing this isn't enough. This is the next error I get:

Uncaught SyntaxError: missing variable name

IntelliJ even shows me about 60 syntax errors.

Shryne avatar Aug 05 '22 08:08 Shryne

I have to verify that. meanwhile can you pick the minified js from dist folder in github and verify that works for you

mrin9 avatar Aug 05 '22 23:08 mrin9

The dist version does work. Thanks :)

Shryne avatar Aug 15 '22 08:08 Shryne

closing it as 9.3.4-beta works

mrin9 avatar Sep 09 '22 00:09 mrin9