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

event argument has no target.result property on IDBRequest: success event #30669

Open
mcshaz opened this issue Mar 31, 2019 · 3 comments
Open
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Milestone

Comments

@mcshaz
Copy link

mcshaz commented Mar 31, 2019

TypeScript Version: 3.4.0-dev.201
updated mar 1 & still no fix
https://github.com/Microsoft/TypeScript/blob/00bf32ca3967b07e8663d0cd2b3e2bbf572da88b/lib/lib.webworker.d.ts
goto line 1860

Search Terms:
onsuccess target result eventtarget idbrequest

Code
please note this code is a cut & past from https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Generating_handlers

var request = indexedDB.open("MyTestDatabase");
request.onsuccess = function(event) {
  db = event.target.result;
};

Expected behavior:
no error

Actual behavior:
error TS2339: Property 'result' does not exist on type 'EventTarget'

Playground Link: N/A

Related Issues:
FileReader.onLoad/onLoadEnd event argument has no target.result property #4163 (Fixed)
IDBOpenDBRequest.onupgradeneeded also needs the same augmentation
IDBTransaction.onerror event.target.error will most likely also need type definitions updated

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Apr 9, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 9, 2019
@grzegorzjudas
Copy link

Looks like this issue is still there. Have you been able to resolve it somehow?

@jibi966
Copy link

jibi966 commented Jan 19, 2023

Hi, is there any progress on this bug? I can't actually catch some DOM Exception due to this. (currently maintaining by @ts-ignore)

@randomchars42
Copy link

seems related to #28293

there's a workaround mentioned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants