jvandemo / generator-angular2-library

Yeoman generator to create an Angular library
MIT License
752 stars 122 forks source link

Playground encounters 404 errors for rxjs #244

Open sishuoyang opened 6 years ago

sishuoyang commented 6 years ago

Hi,

I need some helps here to get my library project running using the playground. Appreciate any pieces of advice.

I can successfully compile the library to dist folder. When I run npm lite, I get this error in browser console window: image There is also an 404 error in the lite-server: image

Below is my systemjs.config.js:

'use strict';
/**
 * System configuration for Angular samples
 * Adjust as necessary for your application needs.
 */
(function () {
  System.config({
    paths: {
      // paths serve as alias
      'npm:': '../node_modules/'
    },
    // map tells the System loader where to look for things
    map: {
      // our app is within the app folder
      app: 'app',

      // angular bundles
      '@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',

      // other libraries
      rxjs: 'npm:rxjs',
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
      'ng-lib-test': '../dist'
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      app: {
        defaultExtension: 'js',
        meta: {
          './*.js': {
            loader: 'systemjs-angular-loader.js'
          }
        }
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'ng-lib-test': {
        main: 'ng-lib-test.umd.js',
        defaultExtension: 'js'
      }
    }
  });
})(this);
caroso1222 commented 6 years ago

Related: https://github.com/jvandemo/generator-angular2-library/issues/255

jvandemo commented 6 years ago

@caroso1222 — Thank you for your follow-up.

@izifortune — Would you be able to have a look a this?

Thanks in advance!

zgabievi commented 6 years ago

Same here:

image

Any updates?

izifortune commented 6 years ago

Hi @sheldonyss do you have the same problem running npm run playground ? Because npm run lite its meant to be runned only inside the other command not as a standalone

TeodorKolev commented 6 years ago

Same here

zxxsinventory commented 6 years ago

Same here. I got 404 at fetch.js at first, then i deleted .playground and got 404 at system.src.js