RMLio / yarrrml-parser

A YARRRML parser library and CLI in Javascript
MIT License
41 stars 17 forks source link

yarrrml-parser breaks with Node v16 #149

Closed julianrojas87 closed 2 years ago

julianrojas87 commented 2 years ago

Issue type: :bug: Bug

Description

YARRRML parsing fails when running under Node v16. It looks like an issue of the graphy.js dependency according to the logs:

$ yarrrml-parser -i ../test/mappings/ERATV-vehicle-types.yml 
/home/julian/Desktop/yarrrml-parser/node_modules/@graphy/memory.dataset.fast/main.js:776
                si_norm_gs += sc1_subject+'\8';
                                           ^

SyntaxError: \8 and \9 are not allowed in strict mode.
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/julian/Desktop/yarrrml-parser/lib/tools.js:19:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

With Node version <=14 seems to work fine.

Environment

DylanVanAssche commented 2 years ago

I can reproduce this issue.

bjdmeest commented 2 years ago

Ah yes, graphy broke in v4.3.4 (see https://github.com/blake-regalia/graphy.js/issues/49 ), sticking the version to v4.3.3 fixes it

julianrojas87 commented 2 years ago

I see, then it is needed to fix graphy's version 4.3.3 here until its problems are fixed or drop it completely and rely on e.g. n3.js entirely (I guess this might be more difficult).

Happy to provide a PR with the easy fix ;)

DylanVanAssche commented 2 years ago

@julianrojas87 Sure, feel free to make a PR :)

DylanVanAssche commented 2 years ago

I have a fix incoming, stay tuned!

DylanVanAssche commented 2 years ago

@julianrojas87 Can you try the latest development branch to see if your issue is fixed?

DylanVanAssche commented 2 years ago

Fixed in v1.3.4