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

Issue with systemjs and decorators #3441

Closed
subesokun opened this issue Jun 9, 2015 · 3 comments
Closed

Issue with systemjs and decorators #3441

subesokun opened this issue Jun 9, 2015 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@subesokun
Copy link

Hi, I'm using TSC 1.5.3 (latest head) and I'm trying to compile following piece of code

@SomeDecorator()
export class App {
  constructor() {
  }
}
{"compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "system",
    "target": "es5"
}}

which will then produce following code

var __decorate = ...;
var __metadata = ...;
System.register([], function(exports_1) { ... };

Now this doesn't really play nice together with systemjs and it works for me only when manually moving the var __decorate and var __metadata declarations into the anonymous function function(exports_1) { ..here... }. Not sure if it's really valid to have these variable declarations outside of the System.register.

@subesokun
Copy link
Author

It seems like these declarations outside of System.register are crashing the format detection of systemjs. When adding manually a meta override as workaround like the following it's working again.

System.config({
  "meta": {
    "app.js": {
      "format": "register"
    }
  }
});

(please note that these metadata overrides are first available starting from SystemJS 0.17.0)

@mhegazy
Copy link
Contributor

mhegazy commented Jun 9, 2015

looks like a duplicate of #3364

@mhegazy mhegazy closed this as completed Jun 9, 2015
@mhegazy mhegazy added the Duplicate An existing issue was already created label Jun 9, 2015
@subesokun
Copy link
Author

Thanks for the pointer, yes looks like a duplicate of #3364

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants