inrupt / generator-solid-angular

Generator for Solid Angular applications
MIT License
31 stars 12 forks source link

Cannot find namespace '$rdf' #13

Closed tiagosomda closed 5 years ago

tiagosomda commented 5 years ago

I went through the steps described on the readme.md and when I ran 'ng serve'

I was getting the following errors:

ERROR in src/app/services/rdf.service.ts(33,12): error TS2503: Cannot find namespace '$rdf'.
src/app/services/rdf.service.ts(41,18): error TS2503: Cannot find namespace '$rdf'.
src/app/services/rdf.service.ts(323,58): error TS2503: Cannot find namespace '$rdf'.

I checked the file src/app/services/rdf.service.ts and the following line was commented out: import * as $rdf from 'rdflib'

I uncommented it and the project built and I was able to load the page.

@james-martin-jd - is there a reason why that line needed to commented out? I saw that you recently commented it out to fix an "issue where rdflib was throwing errors" https://github.com/Inrupt-inc/generator-solid-angular/commit/1c91ae705d3b37f6567d929273154583d7012e4a#diff-dca975bf5ad72321f0990d8416fddab0

tiagosomda commented 5 years ago

Created a pull request (https://github.com/Inrupt-inc/generator-solid-angular/pull/14) if you think we should uncomment it

james-martin-jd commented 5 years ago

That's interesting, I was getting the opposite issue where I was unable to import rdflib using this method. This was changed in a PR, where we were just declaring the variable and including it in the index.html, so I reverted back to that method to prevent the errors, which worked locally. I'll investigate.

tiagosomda commented 5 years ago

Do you need some info from my machine/environment to help debug that?

james-martin-jd commented 5 years ago

Thanks for the offer! I'm checking into it right now - I doubt it's specific to an OS at the moment. I wonder if it's something locally on my dev machine that's configured weird. Like an extra package declaration or something.

james-martin-jd commented 5 years ago

To follow up on this, I opened an issue on rdflib github to fix imports. When I use the import instead of Githubissues.

  • Githubissues is a development platform for aggregating issues.