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

Decorated method can't resolve design:paramtypes #17080

Closed
monkeycatdog opened this issue Feb 14, 2020 · 3 comments · Fixed by #17083
Closed

Decorated method can't resolve design:paramtypes #17080

monkeycatdog opened this issue Feb 14, 2020 · 3 comments · Fixed by #17083
Assignees
Labels
area: @ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@monkeycatdog
Copy link

🐞 bug report

Affected Package

    "@angular/animations": "^9.0.0",
    "@angular/cdk": "^9.0.0",
    "@angular/common": "^9.0.0",
    "@angular/compiler": "^9.0.0",
    "@angular/core": "^9.0.0",
    "@angular/forms": "^9.0.0",
    "@angular/material": "^9.0.0",
    "@angular/material-moment-adapter": "^9.0.0",
    "@angular/platform-browser": "^9.0.0",
    "@angular/platform-browser-dynamic": "^9.0.0",
    "@angular/router": "^9.0.0",
    "@angular/service-worker": "^9.0.0"

Actually, I don't know about affected packages, maybe it's compiler ?

Is this a regression?

Yes, the previous version in which this bug was not present was: Angular 8

Description

So, I use a package decko, it's just decorators.
I bound my methods and they can't work now

🔬 Minimal Reproduction

class MyService {

@bind()
method(control: FormControl){}
}

🔥 Exception or Error


 Object(r.c)([Object(u.bind)(), Object(r.f)("design:type", Function), Object(r.f)("design:paramtypes", [FormControl]), Object(r.f)("design:returntype", Object)], t.prototype, "method", null)
   
main.d4d36d120046e5300844.js:formatted:609 Uncaught ReferenceError: FormControl is not defined
    at main.d4d36d120046e5300844.js:formatted:609
    at Object.0poW (main.d4d36d120046e5300844.js:formatted:615)
    at d (VM100 runtime.13bd04fd7c2374627883.js:1)
    at Object.gfmY (main.d4d36d120046e5300844.js:formatted:9885)
    at d (VM100 runtime.13bd04fd7c2374627883.js:1)
    at Object.7Y4b (main.d4d36d120046e5300844.js:formatted:1873)
    at d (VM100 runtime.13bd04fd7c2374627883.js:1)
    at Module.zUnb (main.d4d36d120046e5300844.js:formatted:13499)
    at d (VM100 runtime.13bd04fd7c2374627883.js:1)
    at Object.0 (main.d4d36d120046e5300844.js:formatted:263)

🌍 Your Environment

Angular Version:


Angular CLI: 9.0.1
Node: 10.16.3
OS: darwin x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router
... service-worker
Ivy Workspace: No

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.1
@angular-devkit/build-angular      0.900.1
@angular-devkit/build-ng-packagr   0.900.1
@angular-devkit/build-optimizer    0.900.1
@angular-devkit/build-webpack      0.900.1
@angular-devkit/core               9.0.1
@angular-devkit/schematics         9.0.1
@angular/cli                       9.0.1
@ngtools/webpack                   9.0.1
@schematics/angular                9.0.1
@schematics/update                 0.900.1
ng-packagr                         9.0.0
rxjs                               6.5.3
typescript                         3.7.5
webpack                            4.41.2

It resolved if i remove @bind() and use arrow function.

@tomamatics
Copy link

Same issue here.

@tomamatics
Copy link

tomamatics commented Feb 18, 2020

my workaround looks like this

from:
@MyDecorator() delete(book: Book): void
to:
@MyDecorator() delete<T extends Book>(book: T): void

also, i think https://github.com/angular/angular/issues/35380 relates to the same issue:

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 28, 2020
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants