Skip to content

Error encountered resolving symbol values statically #12860

Closed

Description

@filipesilva

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request

Current behavior
When compiling a hybrid Angular1/2 application created with @upgrade/upgrade/static, using @types/angular+@types/angular-router and trying to to use a Angular 1 type annotation on a component constructor:

@Component({
  // ...
})
export class PhoneDetailComponent {
  // ...
  constructor(@Inject('$routeParams')
                $routeParams: angular.route.IRouteParamsService,
              phone: Phone) {
// ...

This error is displayed:

Failed on type {"filePath":"D:/work/angular.io/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts","name":"PhoneDetailComponent"} with error Error: Error encountered resolving symbol values statically. Expression form not supported (position 27:31 in the original .ts file), resolving symbol PhoneDetailComponent in D:/work/angular.io/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts
Error: Error encountered resolving symbol values statically. Expression form not supported (position 27:31 in the original .ts file), resolving symbol PhoneDetailComponent in D:/work/angular.io/public/docs/_examples/upgrade-phonecat-2-hybrid/ts/app/phone-detail/phone-detail.component.ts
    at simplifyInContext (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler-cli\src\static_reflector.js:470:23)
    at StaticReflector.simplify (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler-cli\src\static_reflector.js:473:22)
    at StaticReflector.parameters (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler-cli\src\static_reflector.js:101:47)
    at CompileMetadataResolver.getDependenciesMetadata (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:14671:56)
    at CompileMetadataResolver.getTypeMetadata (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:14636:28)
    at CompileMetadataResolver.getDirectiveMetadata (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:14411:30)
    at D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:13422:44
    at Array.forEach (native)
    at _extractModulesAndPipesOrDirectives (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:13420:28)
    at analyzeNgModules (D:\work\angular.io\public\docs\_examples\node_modules\@angular\compiler\bundles\compiler.umd.js:13176:16)
Compilation failed

Where line 27, col 31 is as shown:
image

Expected behavior
No error present.

Minimal reproduction of the problem with instructions
Install @types/angular @types/angular-router, and annotate an injectable with angular.route.IRouteParamsService.

Please tell us about your environment:
Windows 10, VS Code, NPM, ngc

  • Angular version: 2.0.X
    2.2.0-rc.0
  • Browser: Chrome 54
  • Language: TypeScript 2.0.3

  • Node (for AoT issues): node --version = v6.5.0

/cc @tbosch @petebacondarwin

Activity

  1. DzmitryShylovich commented on Nov 14, 2016

    @DzmitryShylovich
    Contributor

    @Inject('$routeParams') $routeParams: angular.route.IRouteParamsService

    #12631

  2. filipesilva commented on Nov 14, 2016

    @filipesilva
    ContributorAuthor

    @DzmitryShylovich thank you, this definitely looks like a dupe of that one.

  3. angular-automatic-lock-bot commented on Sep 10, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions