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

 

 

 

 

1
17 comments

Works for me:

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

0
Avatar
Permanently deleted user

Hi Elena,

This is what I get:

0

Please Ctrl+click on Object, not on values

0
Avatar
Permanently deleted user

Sorry did not read properly..  #classic

0
Avatar
Permanently deleted user

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

0

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

0
Avatar
Permanently deleted user

Typescript 

"typescript": "~2.3.3"
0

Make sure to add

"lib": ["es2017"]

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

0
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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

0

>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
Avatar
Permanently deleted user

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

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
Avatar
Permanently deleted user

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

>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
Avatar
Permanently deleted user

Thank you, Elena.

For my case, changing to

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

in tsconfig.json did the trick.

Cheers.

0
Avatar
Permanently deleted user

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

0

Please sign in to leave a comment.