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 'OnInstalledReason' does not exist on type 'typeof runtime'.ts(2339) #77

Open
ezolcem opened this issue Jun 30, 2024 · 2 comments

Comments

@ezolcem
Copy link

ezolcem commented Jun 30, 2024

https://developer.chrome.com/docs/extensions/reference/api/runtime#example-uninstall-url

chrome.runtime.onInstalled.addListener(details => {
  if (details.reason === chrome.runtime.OnInstalledReason.INSTALL) {
    chrome.runtime.setUninstallURL('https://example.com/extension-survey');
  }
});

TypeScript gives error:

Property 'OnInstalledReason' does not exist on type 'typeof runtime'.ts(2339)

@ouweiya
Copy link

ouweiya commented Sep 4, 2024

The @types/chrome type library seems to be more comprehensive.

@ad1992
Copy link

ad1992 commented Sep 11, 2024

The @types/chrome type library seems to be more comprehensive.

I agree, there are few types missing from chrome-types in addition to the above - chrome.runtime.lastError also isn't available as well, however @types/chrome works well.

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