Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in web browser console: Unable to load transpiler to transpile #972

Closed
luis985 opened this issue Feb 16, 2017 · 2 comments
Closed
Milestone

Comments

@luis985
Copy link

luis985 commented Feb 16, 2017

  • angular version: 2.4.0
  • jquery version: 3.1.1
  • datatables version: 1.10.13
  • angular-datatables version: 2.1.0

My problem is the next:

error in web browser console:

Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:3000/traceur
	Error: XHR error (404 Not Found) loading http://localhost:3000/traceur
	    at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1190:29) [<root>]
	    at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:166:47) [<root> => <root>]
	    at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:416:38) [<root>]
	Error loading http://localhost:3000/traceur
	Unable to load transpiler to transpile http://localhost:3000/node_modules/angular-datatables/index.js
	Error loading http://localhost:3000/node_modules/angular-datatables/index.js as "angular-datatables" from http://localhost:3000/app/app.module.js
	    at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:3000/node_modules/zone.js/dist/zone.js:1190:29) [<root>]
	    at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:166:47) [<root> => <root>]
	    at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:416:38) [<root>]
	Error loading http://localhost:3000/traceur
	Unable to load transpiler to transpile http://localhost:3000/node_modules/angular-datatables/index.js
	Error loading http://localhost:3000/node_modules/angular-datatables/index.js as "angular-datatables" from http://localhost:3000/app/app.module.js
    at addToError (http://localhost:3000/node_modules/systemjs/dist/system.src.js:122:78) [<root>]
    at linkSetFailed (http://localhost:3000/node_modules/systemjs/dist/system.src.js:695:21) [<root>]
    at http://localhost:3000/node_modules/systemjs/dist/system.src.js:495:9 [<root>]
    at Zone.run (http://localhost:3000/node_modules/zone.js/dist/zone.js:126:43) [<root> => <root>]
    at http://localhost:3000/node_modules/zone.js/dist/zone.js:679:57 [<root>]
    at Zone.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:166:47) [<root> => <root>]
    at drainMicroTaskQueue (http://localhost:3000/node_modules/zone.js/dist/zone.js:529:35) [<root>]
    at XMLHttpRequest.ZoneTask.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:420:25) [<root>]

systemjs.config.js

(function (global) {
  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',
      // angular-datatables dependencies
      'jquery':                     'npm:jquery/dist/jquery.js',
      'datatables.net':             'npm:datatables.net/js/jquery.dataTables.js',
      'angular-datatables':         'npm:angular-datatables'
    },
    // packages tells the System loader how to load when no filename and/or no extension
    packages: {
      app: {
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      'angular-datatables': {
         main: './index.js',
         defaultExtension: 'js'
       }
    }
  });
})(this);

package.json

{
  "name": "angular-quickstart",
  "version": "1.0.0",
  "description": "QuickStart package.json from the documentation, supplemented with testing support",
  "scripts": {
    "build": "tsc -p src/",
    "build:watch": "tsc -p src/ -w",
    "build:e2e": "tsc -p e2e/",
    "serve": "lite-server -c=bs-config.json",
    "serve:e2e": "lite-server -c=bs-config.e2e.json",
    "prestart": "npm run build",
    "start": "concurrently \"npm run build:watch\" \"npm run serve\"",
    "pree2e": "npm run build:e2e",
    "e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
    "preprotractor": "webdriver-manager update",
    "protractor": "protractor protractor.config.js",
    "pretest": "npm run build",
    "test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
    "pretest:once": "npm run build",
    "test:once": "karma start karma.conf.js --single-run",
    "lint": "tslint ./src/**/*.ts -t verbose"
  },
  "keywords": [],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@angular/common": "~2.4.0",
    "@angular/compiler": "~2.4.0",
    "@angular/core": "~2.4.0",
    "@angular/forms": "~2.4.0",
    "@angular/http": "~2.4.0",
    "@angular/platform-browser": "~2.4.0",
    "@angular/platform-browser-dynamic": "~2.4.0",
    "@angular/router": "~3.4.0",
    "angular-datatables": "^2.1.0",
    "angular-in-memory-web-api": "~0.2.4",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "rxjs": "5.0.1",
    "systemjs": "0.19.40",
    "zone.js": "^0.7.4"
  },
  "devDependencies": {
    "concurrently": "^3.2.0",
    "lite-server": "^2.2.2",
    "typescript": "~2.0.10",
    "canonical-path": "0.0.2",
    "tslint": "^3.15.1",
    "lodash": "^4.16.4",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~4.0.14",
    "rimraf": "^2.5.4",
    "@types/node": "^6.0.46",
    "@types/jasmine": "2.5.36"
  },
  "repository": {}
}

app.module.ts

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule, JsonpModule } from '@angular/http'
import { DataTablesModule  } from 'angular-datatables';

import { AppComponent }  from './app.component';
import { FunctionsComponent } from './Functions/functions.component'
import { FunctionsService } from './Functions/functions.service'

@NgModule({
  imports:      [ BrowserModule, 
                  HttpModule, 
                  JsonpModule,
                  DataTablesModule ],

  declarations: [ AppComponent,
                  FunctionsComponent ],

  providers:    [FunctionsService],

  bootstrap:    [ AppComponent ]
  
})
export class AppModule { }

I need to help please, for fix issue.

@l-lin
Copy link
Owner

l-lin commented Feb 17, 2017

For now, angular-datatables only supports with angular-cli, so no UMD yet...
I'll try to do something this week-end.

@l-lin l-lin added this to the v2.2.0 milestone Feb 17, 2017
@luis985
Copy link
Author

luis985 commented Feb 17, 2017

I resolved translate the next files:

angular-datatables
-dist
angular.datatables.js
angular.datatables.module.js
angular.datatables.directive.js

index.js

with babel. ES6 -> ES5. Best regards and programming happiness.

l-lin added a commit that referenced this issue Feb 19, 2017
- Use @angular/cli version 1.0.0-beta.32.3
- Use rollup to generate bundles
  - `package.json` shamelessly copied from
https://github.com/bbottema/ng2-simple-page-scroll
@l-lin l-lin closed this as completed Feb 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants