AtesComp / rdf-transform

RDF Transform is an extension for OpenRefine to transform data into RDF formats.
Other
28 stars 7 forks source link

RDF Transform extension causes javascript error in Safari #17

Closed ostephens closed 1 year ago

ostephens commented 2 years ago

To recreate:

Error is:

[Error] SyntaxError: Unexpected token '{'
    (anonymous function) (project-bundle.js:54566)

which references this part of the code

    // Setup default Master Root Node (copy as needed)...
    static gnodeMasterRoot = {};
    static {
        this.gnodeMasterRoot.valueSource = {};
        this.gnodeMasterRoot.valueSource.source = null; // ...to be replaced with row / record index
        this.gnodeMasterRoot.expression = {};
        this.gnodeMasterRoot.expression.language = RDFTransform.gstrDefaultExpLang;
        this.gnodeMasterRoot.expression.code = null; // ...to be replaced with default language expression
        this.gnodeMasterRoot.propertyMappings = [];
    }

specifically the error occurs at https://github.com/AtesComp/rdf-transform/blob/bc8a191252b3f92c14f24440139f3edc60a03d35/src/main/resources/module/scripts/rdf-transform.js#L93

If I instead access the UI via Chrome, the project loads and no errors are reported in the console

ostephens commented 2 years ago

What could be the same error but with Firefox rather than Safari was reported on the OpenRefine mailing list https://groups.google.com/g/openrefine/c/U_XhP9sFBCY/m/28KtKSoIBAAJ

AtesComp commented 2 years ago

Does your version of Safari support ES6 properly?

ostephens commented 2 years ago

Safari version is Version 16.0 (17614.1.25.9.10, 17614) I'm no expert in ES6 support, but from what I can tell... yes https://kangax.github.io/compat-table/es6/

AtesComp commented 2 years ago

I'll update with a new release from the current code that should fix this issue. In the meantime, you can compile your own if you like.

AtesComp commented 2 years ago

Any input on this issue and the proposed fix in the new release?