0

Trying to get angular2-in-memory-web-api working with my project. Made progress but now getting (SystemJS) Provider parse errors:(…). Seems straight forward not sure what I'm missing , everything compiles, I'm not getting any 404's so I know all is ended up in the /dist..

Sorry about the formatting

Package.json   

  {
    "name": "crestron-hydrogen",
    "version": "v1.0.3",
    "scripts": {
      "tsc": "tsc",
      "tsc:w": "tsc -w",
      "lite": "lite-server",
      "postinstall": "npm run typings install",
      "start": "gulp serve",
      "typings": "typings",
      "test": " \"karma start karma.conf.js\" ",
      "test-once": "karma start karma.conf.js --single-run",
      "gulp": "gulp"
    },
    "license": "ISC",
    "dependencies": {
      "@angular/common": "2.0.0",
      "@angular/compiler": "2.0.0",
      "@angular/core": "2.0.0",
      "@angular/forms": "2.0.0",
      "@angular/http": "2.0.0",
      "@angular/platform-browser": "2.0.0",
      "@angular/platform-browser-dynamic": "2.0.0",
      "@angular/router": "3.0.0",
      "@angular/upgrade": "2.0.0",
      "angular2-busy": "1.0.2",
      "angular2-i18next": "0.0.59",
      "angular2-in-memory-web-api": "0.0.21",
      "core-js": "2.4.1",
      "i18next": "3.4.1",
      "i18next-browser-languagedetector": "1.0.0",
      "i18next-xhr-backend": "1.1.0",
      "ng2-completer": "0.2.3",
      "primeng": "1.0.0-beta.17",
      "primeui": "4.1.15",
      "reflect-metadata": "0.1.8",
      "rxjs": "5.0.0-beta.12",
      "systemjs": "0.19.39",
      "ts-smart-logger": "0.0.4",
      "zone.js": "0.6.23"
    },
    "devDependencies": {
      "@types/node": "^6.0.45",
      "browser-sync": "2.16.0",
      "concurrently": "2.0.0",
      "del": "2.2.2",
      "gulp": "3.9.1",
      "gulp-flatten": "0.2.0",
      "gulp-sourcemaps": "1.6.0",
      "gulp-typescript": "3.0.2",
      "gulp-uglify": "2.0.0",
      "gulp-zip": "3.2.0",
      "jasmine-core": "2.4.1",
      "karma": "1.2.0",
      "karma-chrome-launcher": "0.2.3",
      "karma-cli": "0.1.2",
      "karma-jasmine": "0.3.8",
      "run-sequence": "1.2.2",
      "typescript": "1.8.10",
      "typings": "1.3.0"
    }
  }

System.js

    (function(global) {

   // map tells the System loader where to look for things
      var map = {
        'app':  'app',
        '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
        '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
        '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
        '@angular/platform-browser': 'npm:@angular/platform-            browser/bundles/platform-browser.umd.js',
        '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-    dynamic/bundles/platform-browser-dynamic.umd.js',
        '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
        '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
        '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',


        'portalservice-devices': 'http://portalservice-    devices.azurewebsites.net/app/boot.js',
    'portalservice-groups': 'http://portalservice-    groups.azurewebsites.net/app/boot.js',
        'portalservice-template': 'http://portal-service-    template.azurewebsites.net/app/boot.js',

        'proxyservice-devices': 'http://localhost:3001/app/boot.js',
        'proxyservice-groups': 'http://localhost:3002/app/boot.js',
        'proxyservice-template': 'http://localhost:3003/app/boot.js',

        'rxjs':              'node_modules/rxjs',
        'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
        '@angular':     'node_modules/@angular',
        'primeng':       'node_modules/primeng',
        'jssha':            'node_modules/jssha/src', 
        'ts-smart-logger': 'node_modules/ts-smart-logger', 
        'angular2-i18next': 'node_modules/angular2-i18next',

        'i18next': 'node_modules/angular2-    i18next/node_modules/i18next/i18next.min.js',
    'i18next-xhr-backend': 'node_modules/angular2-i18next/node_modules/i18next-    xhr-backend/i18nextXHRBackend.min.js', 

        'ts-metadata-helper': 'npm:ts-metadata-helper',
        'angular2-dynamic-component': 'npm:angular2-dynamic-component',
        'angular2-busy': 'npm:angular2-busy',
        'ng2-completer': 'npm:ng2-completer/bundles',
      };

      // packages tells the System loader how to load when no filename and/or no     extension
      var packages = {
        'app':                            { main: 'boot.js',  defaultExtension:         'js' },
    'rxjs':                           { defaultExtension: 'js' },
        'primeng':                        { defaultExtension: 'js' },
        'jssha': { main: 'sha512.js', defaultExtension: 'js' }, 
        'ts-smart-logger': { defaultExtension: 'js' },
        'angular2-i18next': { defaultExtension: 'js' },
        'i18next': { defaultExtension: 'js' },
        'i18next-xhr-backend': { defaultExtension: 'js' },
        'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
        'ts-metadata-helper': { defaultExtension: 'js' },
        'angular2-dynamic-component': { defaultExtension: 'js' },
        'angular2-busy': { main: './index.js', defaultExtension: 'js' },

        'ng2-completer': { main: 'ng2-completer.js', format: 'cjs' } 
      };

      var config = {
            defaultJSExtensions: true,
            map: map,
            packages: packages,
            paths: {
              // paths serve as alias
          'npm:': './node_modules/'
                }
     }

  // filterSystemConfig - index.html's chance to modify config before we register it.
  if (global.filterSystemConfig) { global.filterSystemConfig(config); }

  System.config(config);

})(this);
1
  • can you fix your formatting and provide the specific error you're getting? Commented Nov 7, 2016 at 20:39

1 Answer 1

2

The name of the package changed. Update to "angular-in-memory-web-api": "0.1.14" now that you are using @angular/* 2.*

Sign up to request clarification or add additional context in comments.

4 Comments

Ok trying 0.1.14 with new name .. Now I get the following error, tsc node_modules/angular-in-memory-web-api/in-memory-backend.service.d.ts(1,1): erro r TS2688: Cannot find type definition file for 'core-js'.
Googled that error , removed reference to core in in-memory-backend.service.d.ts then changed systemJs reference to 'angular-in-memory-web-api': 'node_modules/angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', Back to square one (SystemJS) Provider parse errors:(…) sigh
Don't use 0.1.14. there is a regression bug. Use 0.1.13
1.1.13 same error Provider parse errors. Seems like something else is the cause.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.