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

Property 'find' does not exist on type 'Token[]'. #928

Closed
SeanningTatum opened this issue Nov 21, 2018 · 9 comments
Closed

Property 'find' does not exist on type 'Token[]'. #928

SeanningTatum opened this issue Nov 21, 2018 · 9 comments

Comments

@SeanningTatum
Copy link

SeanningTatum commented Nov 21, 2018

Typescript recognize es6 array functions

function findDate(tokenArray: Array<Token>) {

  // Find Month in sentence
  const token: Token = tokenArray.find((token) => {
    const month = token.text.content.toUpperCase()

    return MONTHS.includes(month)
  })

  console.log(token)

  return ''
}

I've tried creating a tsconfig.json but still doesn't work

{
  "compilerOptions": {
    "module": "es6",
    "lib": [ "es2017", "dom" ]
  }
}
@fhinkel
Copy link
Contributor

fhinkel commented Nov 21, 2018

Hi, thanks for raising the issue. For which sample is this? It should work if you use "target": "es6" in the config.

@SeanningTatum
Copy link
Author

@fhinkel Hi this is on the typescript sample. I've adjusted my tsconfig.json to

{
"compilerOptions": {
    "target": "es6",
    "sourceMap": true
  }
}

But I still get a compilation error Property 'includes' does not exist on type 'String[]' and Property 'find' does not exist on type 'Token[]'.

@fhinkel
Copy link
Contributor

fhinkel commented Dec 9, 2018

@JustinBeckwith Could you have a look at the typescript samples? Thanks

@JustinBeckwith
Copy link
Contributor

Greetings @SeanningTatum! I can't find the exact code you're trying anywhere in the repo, or any of the other repositories we have here. Could you share the specific file where you're seeing this stuff? Including the url?

If all else fails, a complete example (that I can run) would be super, super helpful :)

@SeanningTatum
Copy link
Author

SeanningTatum commented Dec 12, 2018

@JustinBeckwith I was running the with-typescript example. And sorry I can't provide you a complete example.

@JustinBeckwith
Copy link
Contributor

Can you point us towards the with-typescript sample? Can you give me a url?

@fhinkel
Copy link
Contributor

fhinkel commented Dec 17, 2018

We updated the sample. Could you try again? Thanks!

@fhinkel
Copy link
Contributor

fhinkel commented Feb 6, 2019

Closing this due to inactivity. Let us know if the update didn't fix it and we can reopen the issue.

@fhinkel fhinkel closed this as completed Feb 6, 2019
ace-n pushed a commit that referenced this issue Nov 16, 2022
🤖 I have created a release *beep* *boop*
---


## [5.0.3](googleapis/nodejs-speech@v5.0.2...v5.0.3) (2022-09-22)


### Bug Fixes

* Preserve default values in x-goog-request-params header ([#928](googleapis/nodejs-speech#928)) ([ea654b5](googleapis/nodejs-speech@ea654b5))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
telpirion pushed a commit that referenced this issue Nov 16, 2022
🤖 I have created a release \*beep\* \*boop\*
---
### [2.3.7](https://www.github.com/googleapis/nodejs-vision/compare/v2.3.6...v2.3.7) (2021-07-21)


### Bug Fixes

* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#928](https://www.github.com/googleapis/nodejs-vision/issues/928)) ([f5cddc5](https://www.github.com/googleapis/nodejs-vision/commit/f5cddc5086a96ddc4255017366422df40a6efaf5))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n pushed a commit that referenced this issue Nov 17, 2022
🤖 I have created a release *beep* *boop*
---


## [5.0.3](googleapis/nodejs-speech@v5.0.2...v5.0.3) (2022-09-22)


### Bug Fixes

* Preserve default values in x-goog-request-params header ([#928](googleapis/nodejs-speech#928)) ([ea654b5](googleapis/nodejs-speech@ea654b5))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants