CSS Injector [Official Support]

Thanks, that was helpful!

The error comes from this line in injector.js:

while (!NoteEditor.instances[0]?.fields?.length) {

@Maeshara @Avalanche Which OS are you running Anki on? I guess your system doesn’t support the ?. syntax (Optional chaining operator) yet.

I’ve pushed an update that translates the source code into an older JavaScript version (es2018 instead of esnext), so the compiled code won’t contain that problematic syntax.


Little rant: I’ve had this issue a couple of times already and I wonder when we can finally use this basic syntax without having to worry about cross-platform compatibility. As seen here, all major browsers already support it:

1 Like