unresolved function or method Object.values()

Hi,

I'm getting this red warning, the codes compiles fine, is just annoying to see the underlying files on the project explorer.

 

There is any way of enabling es2017?

Thank you very much in advance!

Best,
Francisco

 

 

 

 

17 comments
Comment actions Permalink

>since i'm using angular-cli I have 2 tsconfig.json files more. could this cause the issue?

No; in your project, you actually have a single configuration file - only tsconfig.json files are respected, tsserver doesn't work with files like tsconfig.app.json

Works for me using same settings:

 

can you check if the service was started successfully? What is logged in TypeScript tool window?

1
Comment actions Permalink

That's maybe it Elena, 

The service has not started, even though as you saw above is turned on. how can I automatically start it? The icon "restart typescript service" does not do anything, and I don't want webstorm to compile my typescript files since I already have webpack doing so.

1
Comment actions Permalink

Works for me:

please try ctrl+clicking on Object - what definition are you taken to?

0
Comment actions Permalink

Hi Elena,

This is what I get:

0
Comment actions Permalink

Please Ctrl+click on Object, not on values

0
Comment actions Permalink

Sorry did not read properly..  #classic

0
Comment actions Permalink

And the Object interface is coming from here (not sure if is helpful)

0
Comment actions Permalink

hmmm... what language is it? JavaScript or Typescript?

0
Comment actions Permalink

Typescript 

"typescript": "~2.3.3"
0
Comment actions Permalink

Make sure to add

"lib": ["es2017"]

to your tsconfig.json and enable TypeScript service in Settings | Languages & Frameworks | TypeScript

0
Comment actions Permalink

I had that already.. since i'm using angular-cli I have 2 tsconfig.json files more. could this cause the issue?

0
Comment actions Permalink

I just tried in the project with a .JS file and it works, only not for Typescript :(

0
Comment actions Permalink

Try changing Typescript version to Bundled in Preferences | Languages & Frameworks | TypeScript, restart the service and make any change to your file (i.e. add a whitespace) - what is the result?

0
Comment actions Permalink

I did change it to bundled (2.4.1) and add a console.log(''). how can I restart the typescript service?

maybe i need some extra plugin?

0
Comment actions Permalink

>how can I restart the typescript service?

using "restart typescript service" button.

If it doesn't help, this may indicate issues with your project (missing/excldued tsconfig.json, for example - service only works when it's available)

0
Comment actions Permalink

Thank you, Elena.

For my case, changing to

"lib": [
"es2017",
"dom"
]

in tsconfig.json did the trick.

Cheers.

0
Comment actions Permalink

In my case was only fixed by upgrading WebStorm to WebStorm-EAP..

0

Please sign in to leave a comment.