solid-client-js: Error when building angular app with solid-client: Module '"../constants"' has no exported member 'acp'

Search terms you’ve used

inrupt module acp

Bug description

npm error when building application with “@inrupt/solid-client”: “^1.0.0”, using angular’s ng build

To Reproduce

  1. generate new angular app (https://angular.io/tutorial/toh-pt0, ng new solid-error)
  2. add solid-client (based on https://docs.inrupt.com/developer-tools/javascript/client-libraries/tutorial/getting-started/, npm install @inrupt/solid-client @inrupt/solid-client-authn-browser @inrupt/vocab-common-rdf)
  3. use import {getSolidDataset, getStringNoLocale, getThing} from '@inrupt/solid-client'; in a component
  4. run app (ng serve)

Expected result

application gets built without error and starts

Actual result

the following error occurs: ERROR in node_modules/@inrupt/solid-client/dist/acp/control.d.ts:21:10 - error TS2305: Module '"../constants"' has no exported member 'acp'.

Environment

$ npx envinfo --system --npmPackages --binaries --npmGlobalPackages --browsers

  System:
    OS: Windows 10 10.0.19041
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 17.01 GB / 31.71 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.423.0), Chromium (86.0.622.69)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @angular-devkit/build-angular: ~0.1001.7 => 0.1001.7
    @angular/animations: ~10.1.6 => 10.1.6
    @angular/cli: ~10.1.7 => 10.1.7
    @angular/common: ~10.1.6 => 10.1.6
    @angular/compiler: ~10.1.6 => 10.1.6
    @angular/compiler-cli: ~10.1.6 => 10.1.6
    @angular/core: ~10.1.6 => 10.1.6
    @angular/forms: ~10.1.6 => 10.1.6
    @angular/platform-browser: ~10.1.6 => 10.1.6
    @angular/platform-browser-dynamic: ~10.1.6 => 10.1.6
    @angular/router: ~10.1.6 => 10.1.6
    @inrupt/solid-client: ^1.0.0 => 1.0.0
    @inrupt/solid-client-authn-browser: ^1.0.0 => 1.0.0
    @inrupt/vocab-common-rdf: ^0.6.3 => 0.6.3
    @types/jasmine: ~3.5.0 => 3.5.14
    @types/jasminewd2: ~2.0.3 => 2.0.8
    @types/node: ^12.11.1 => 12.19.4
    codelyzer: ^6.0.0 => 6.0.1
    jasmine-core: ~3.6.0 => 3.6.0
    jasmine-spec-reporter: ~5.0.0 => 5.0.2
    karma: ~5.0.0 => 5.0.9
    karma-chrome-launcher: ~3.1.0 => 3.1.0
    karma-coverage-istanbul-reporter: ~3.0.2 => 3.0.3
    karma-jasmine: ~4.0.0 => 4.0.1
    karma-jasmine-html-reporter: ^1.5.0 => 1.5.4
    protractor: ~7.0.0 => 7.0.0
    rxjs: ~6.6.0 => 6.6.3
    ts-node: ~8.3.0 => 8.3.0
    tslib: ^2.0.0 => 2.0.3
    tslint: ~6.1.0 => 6.1.3
    typescript: ~4.0.2 => 4.0.5
    zone.js: ~0.10.2 => 0.10.3
  npmGlobalPackages:
    @angular/cli: 10.1.7
    npm: 6.14.8
    windows-build-tools: 5.2.2

Additional information

I’ve created a sample angular project with the error: https://github.com/WhyINeedToFillUsername/solid-error

  • check it out, run npm install and ng serve

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Good to hear you managed to find some way of getting this to work. For some additional context: Webpack 4 and below did natively include those polyfills, but Angular explicitly disabled those. However, if you are able to customise the Webpack configuration for Webpack 4, you might have been able to re-enable the polyfills yourself. That said, if you are now able to use the latest Angular version, that is probably preferable.

As for your final question: that is basically the result of a changing ecosystem. When the project was started, most bundlers included those polyfills by default, and existing crypto libraries that worked in both the browser and Node (that we build on) relied on those being supplied by the developer. Since then, updated versions of libraries have been made available that do indeed fall back to the browser-native utilities first, and we hope to be able to adopt those soon.