Definitelytyped: @types/expo Cannot find name 'WebGLRenderingContext'

Created on 15 Oct 2018  路  4Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/expo package and had problems.
  • [ ] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript (I'm using 3.0.3)
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @KonstantinKai @martynaskadisa @janaagaard75 @ssanchezmarc @fhelwanger @umidbekkarimov @moshfeu @prokopcm @tinaroh @binki @mo

If you do not mention the authors the issue will be ignored.

I tried running tsc and this issue popped up:

node_modules/@types/expo/index.d.ts:1446:52 - error TS2304: Cannot find name 'WebGLRenderingContext'.

1446 export interface ExpoWebGLRenderingContext extends WebGLRenderingContext {

Temporarily commenting out the interface leads to other issues so I guess it's needed a lot.

Could it be a missing package or something else?

Most helpful comment

WebGLRenderingContext is defined in TypeScript's dom lib.

Try do add "dom" to your compilerOptions.lib array.

All 4 comments

WebGLRenderingContext is defined in TypeScript's dom lib.

Try do add "dom" to your compilerOptions.lib array.

@moshfeu yes, but I think it's something on @ddwwcruz 's project tsconfig.json. 馃槃

@ddwwcruz To clarify, what I meant earlier was for you to check your tsconfig.json to see if "dom" is added to the lib array.

If after this the error persists, you could try to setup a small repository to demonstrate the error so we can look at it further.

@fhelwanger you're correct about adding "dom"

Was this page helpful?
0 / 5 - 0 ratings