RMLio / yarrrml-parser

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

TypeError: Class constructor N3Parser cannot be invoked without 'new' - yarrrml-generator #115

Closed robert-mieth closed 3 years ago

robert-mieth commented 3 years ago

Issue type: :bug: Bug

Description

Running yarrrml-generator results in

TypeError: Class constructor N3Parser cannot be invoked without 'new'
    at Object.<anonymous> (C:\Users\Robert\AppData\Roaming\npm\node_modules\@rmlio\yarrrml-parser\bin\generator.js:40:23)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

Steps

Git Bash: yarrrml-generator -i example.rml.ttl

Suggested Fix

Change line 40 of bin/generator.js const parser = N3.Parser(); to const parser = new N3.Parser();

This made the yarrrml-generator usable for me.