angular-seed: SystemJS error when import HttpClient

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)

Current behavior SystemJS error when import HttpClient

Expected behavior No error

Minimal reproduction of the problem with instructions Hi. I’m experiencing problems with adding new HttpClient to SystemJS in Angular seed. I’ve read comments here https://github.com/mgechev/angular-seed/issues/2033, but offered solutions didn’t help. What I’ve done so far:

  1. npm install tslib --save-dev
  2. add these to packages to additionalPackages in tools/config/project.config.ts (as mentioned in @maxklenk comment in issue 2033):
        name: '@angular/common/http',
        path: 'node_modules/@angular/common',
        packageMeta: {
          main: 'bundles/common-http.umd.js',
          defaultExtension: 'js'
        }
      },
      {
        name: 'tslib',
        path: 'node_modules/tslib',
        packageMeta: {
          main: 'tslib.js',
          defaultExtension: 'js'
        }
      }
  1. add HttpClientModule import to app.module.ts

And I get this error as result: http://imgur.com/a/ZoYYW

I did these steps afterwards:

  • delete node modules folder
  • npm cache clean
  • npm install

And still have the same error when run “npm start”. Angular version: 4.3.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

I know this is a closed item, but I wanted to add that @mgechev’s comment helped me:

the cleanest way will be to override SYSTEM_BUILDER_CONFIG in project.config.ts

The syntax to do this is:

this.SYSTEM_BUILDER_CONFIG.packageConfigPaths.push(join('node_modules', '@ngx-translate', '*', 'package.json'));