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

traceur 404 (Not Found) #55

Closed
iwantlern opened this issue Aug 1, 2016 · 21 comments
Closed

traceur 404 (Not Found) #55

iwantlern opened this issue Aug 1, 2016 · 21 comments

Comments

@iwantlern
Copy link

Hi there!
Trying to run package with angular2 5 min quickstart (https://angular.io/docs/ts/latest/quickstart.html) and getting 404 error with traceur.
I've attached result "project". Probably, I am doing something wrong with settings. Can you look?

angular2.zip

@maminarghavani
Copy link

in component:
import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
in systemjs.config.js:
var map = {
'ng2-uploader': 'node_modules/ng2-uploader'
};
and
var packages = {
'ng2-uploader': { defaultExtension: 'js'}
};
maybe help.

@jkuri
Copy link
Contributor

jkuri commented Aug 6, 2016

Hey guys, I prepared example for you. Althought you still need an API server.
@iwantlern the package published on npm also includes compiled .js so you want to include ng2-uploader.js instead of ng2-uploader.ts. The way you want to include it requires in browser compiler. Anyway here's a package:

angular2.zip

Just run: npm install and then npm start.

Also, please let me know if this works for you guys so I can close an issue. Thanks.

@maminarghavani
Copy link

@jkuri
hi and thanks for your example.
can you test your component with angular2-webpack-starter?
i can't get it to work.
thanks.

@jkuri
Copy link
Contributor

jkuri commented Aug 7, 2016

Give me an example where you got stuck and I can take a look.

@maminarghavani
Copy link

i just installed angular2-webpack-starter
and also ng2-upoader but when i add :
directives: [UPLOAD_DIRECTIVES]
and run the server i got this error
EXCEPTION: Error: Uncaught (in promise): No Directive annotation found on NgFileSelect
thanks again

@philippgrimm
Copy link

philippgrimm commented Aug 11, 2016

latest version didnt work with rc5 and latest cli.
get back to 0.5.10 and it works

@jkuri
Copy link
Contributor

jkuri commented Aug 11, 2016

Just tried with the latest version of angular-cli and did work for me (from master).
Here's my app.component.ts if it helps:

import { Component } from '@angular/core';
import { UPLOAD_DIRECTIVES } from 'ng2-uploader';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.css'],
  directives: [UPLOAD_DIRECTIVES]
})
export class AppComponent {
  title = 'app works!';

  uploadFile: any;
  options: Object = {
    url: 'http://ng2-uploader.com:10050/upload'
  };

  handleUpload(data): void {
    if (data && data.response) {
      data = JSON.parse(data.response);
      this.uploadFile = data;
    }
  }
}

@philippgrimm
Copy link

is it also angular rc5 ?

@jkuri
Copy link
Contributor

jkuri commented Aug 11, 2016

yes, tested with creating new project with ng new.

@philippgrimm
Copy link

i think ng new uses rc4, you have to upgrade it manually.

@jkuri
Copy link
Contributor

jkuri commented Aug 11, 2016

Try using latest version of angular-cli from master, if you are unsure how see https://github.com/angular/angular-cli#development-hints-for-hacking-on-angular-cli.

@lacroixdavid1
Copy link

With 5.12, im getting this error

VM18508:1 Uncaught Error: Module build failed: Error: Could not find custom rule directory: C:\ (Project folder) \node_modules\ng2-uploader\node_modules\codelyzer

And

Module build failed: Error: Could not find custom rule directory: C:\ (Project folder) \node_modules\ng2-uploader\node_modules\codelyzer

It refuses to compile with codelyzer 0.27, webpack 2 and ng2 rc5

@jkuri
Copy link
Contributor

jkuri commented Aug 11, 2016

Okay, thanks

On Thursday, 11 August 2016, lacroixdavid1 [email protected] wrote:

With 5.12, im getting this error

VM18508:1 Uncaught Error: Module build failed: Error: Could not find
custom rule directory: C:\ (Project folder) \node_modules\ng2-uploader
node_modules\codelyzer

And

Module build failed: Error: Could not find custom rule directory: C:
(Project folder) \node_modules\ng2-uploader\node_modules\codelyzer

It refuses to compile with codelyzer 0.27, webpack 2 and ng2 rc5


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#55 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABtntjgFMAGW1KtNAbIXaRJkMheSQSDIks5qew_agaJpZM4JZ-Eo
.

@philippgrimm
Copy link

Can you send mir the code oft the running example with latest cli? I dont get it running.

@FunctionalWorm
Copy link

I have the same issue with Angular CLI and Angular2 rc4. Downgraded to 0.5.10 as @dindong said and it works now.
Thanks for your efforts and keep up the good work.

@nastakhov
Copy link

Same here - getting on angular2 RC5
zone.js: GET http://localhost:3000/traceur 404 (Not Found)

works on 0.5.10 version

@MJochim
Copy link

MJochim commented Aug 24, 2016

@jkuri: In e5846dc, you changed the output module format from commonjs to es6 in tsconfig.json. This has made ng2-uploader.js an es6 module, which current browsers cannot load natively (except for Edge I think?).

Now I guess that SystemJS recognises this and tries to load Traceur, which fails because most of the commenters here (including myself) do not use Traceur and haven't configured SystemJS to load it.

This bugged me all the more since I had a dependency on ^0.5.10 and npm/semver installed the – supposedly compatible – 0.5.13, which had breaking changes. But I really don't want to sound too critical. Your work is still great!

@jkuri
Copy link
Contributor

jkuri commented Aug 24, 2016

@MJochim
Copy link

MJochim commented Aug 24, 2016

Although the target is es5, the Typescript compiler will still produce modules in ES2015 syntax. These have import and export statements and look very much like the original Typescript code. Unfortunately, they are not understood by most of today’s browsers.

Just try and set module (https://github.com/jkuri/ng2-uploader/blob/e5846dcdee2493bd7980256254bf713f6045a272/tsconfig.json#L8) to commonjs (as it was before) or system and see what happens to the resulting .js file.

@jkuri
Copy link
Contributor

jkuri commented Aug 24, 2016

Okay, I will update this today. Thanks for notice.

@jkuri
Copy link
Contributor

jkuri commented Aug 26, 2016

38157e8

@jkuri jkuri closed this as completed Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants