inrupt / solid-sdk-forms

A Form Library for the Solid SDK
MIT License
6 stars 0 forks source link

Seeing "TypeError: Cannot read property 'Term' of undefined" from sparql.js when running tests. #94

Open pmcb55 opened 4 years ago

pmcb55 commented 4 years ago

Seems very easy to reproduce - simply checkout the branch feat/use-lit-vocab-term, run npm install && npm test, i.e.:

git clone -b feat/use-lit-vocab-term git@github.com:inrupt/solid-sdk-forms.git
cd solid-sdk-forms
npm install
npm test

...and I see...

[solid-sdk-forms]$ npm test
> @inrupt/solid-sdk-forms@0.2.0 test /home/pmcb55/tmp/solid-sdk-forms
> jest --coverage
 PASS  test/shex-form-model.test.ts
 FAIL  test/solid-fetch.test.ts
  ● Test suite failed to run
    TypeError: Cannot read property 'Term' of undefined
      at Object.<anonymous> (node_modules/sparqljs/lib/Wildcard.js:1:46)
      at node_modules/sparqljs/lib/SparqlParser.js:694:18
      at Object.<anonymous> (node_modules/sparqljs/lib/SparqlParser.js:1538:3)
 FAIL  test/form-ui.test.ts
  ● Test suite failed to run
    TypeError: Cannot read property 'Term' of undefined
      at Object.<anonymous> (node_modules/sparqljs/lib/Wildcard.js:1:46)
      at node_modules/sparqljs/lib/SparqlParser.js:694:18
      at Object.<anonymous> (node_modules/sparqljs/lib/SparqlParser.js:1538:3)
 FAIL  test/form-model.test.ts
  ● Test suite failed to run
    TypeError: Cannot read property 'Term' of undefined
      at Object.<anonymous> (node_modules/sparqljs/lib/Wildcard.js:1:46)
      at node_modules/sparqljs/lib/SparqlParser.js:694:18
      at Object.<anonymous> (node_modules/sparqljs/lib/SparqlParser.js:1538:3)

I updated the package.json to all the latest versions (I think), including TypeScript and TypeDoc, so I've no idea what's going on here.

RubenVerborgh commented 4 years ago

@joachimvh This seems to be in your part of the code 😉

RubenVerborgh commented 4 years ago

@pmcb55 It was found by @joachimvh that this is due to the N3.js version; SPARQL.js is accessing internals that it shouldn't. Will fix there.

RubenVerborgh commented 4 years ago

Fixed in sparqljs@3.0.2.