Skip to content

h.default is not a constructor error after adding unofficial TS definitions #38

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

Closed
alkafaiz opened this issue Dec 23, 2019 · 2 comments
Closed
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue author has not responded scope: types Related to type definitions solution: can't repro An attempt to reproduce has been tried and failed solution: duplicate This issue or PR is a duplicate of another existing one solution: wontfix This will not be changed at this time

Comments

@alkafaiz
Copy link

Hi there, I'm facing this error where ts definitions is not found. I have followed the step in #21 but still not working. This error appears in the console.

Uncaught TypeError: h.default is not a constructor
    at t.value (index.js:1)
    at commitLifeCycles (react-dom.development.js:22101)
    at commitLayoutEffects (react-dom.development.js:25344)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)
    at commitRootImpl (react-dom.development.js:25082)
    at unstable_runWithPriority (scheduler.development.js:697)
    at runWithPriority$2 (react-dom.development.js:12149)
    at commitRoot (react-dom.development.js:24922)
    at finishSyncRender (react-dom.development.js:24329)
    at performSyncWorkOnRoot (react-dom.development.js:24307)
    at react-dom.development.js:12199
    at unstable_runWithPriority (scheduler.development.js:697)
    at runWithPriority$2 (react-dom.development.js:12149)
    at flushSyncCallbackQueueImpl (react-dom.development.js:12194)
    at flushSyncCallbackQueue (react-dom.development.js:12182)
    at discreteUpdates$1 (react-dom.development.js:24423)
    at discreteUpdates (react-dom.development.js:1438)
    at dispatchDiscreteEvent (react-dom.development.js:5881)
Uncaught TypeError: Cannot read property 'off' of null
    at t.r.off (index.js:1)
    at t.value (index.js:1)
    at callComponentWillUnmountWithTimer (react-dom.development.js:21896)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)
    at safelyCallComponentWillUnmount (react-dom.development.js:21903)
    at commitUnmount (react-dom.development.js:22392)
    at commitNestedUnmounts (react-dom.development.js:22486)
    at unmountHostComponents (react-dom.development.js:22810)
    at commitUnmount (react-dom.development.js:22429)
    at commitNestedUnmounts (react-dom.development.js:22486)
    at unmountHostComponents (react-dom.development.js:22810)
    at commitDeletion (react-dom.development.js:22896)
    at commitMutationEffects (react-dom.development.js:25323)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)
    at commitRootImpl (react-dom.development.js:25050)
    at unstable_runWithPriority (scheduler.development.js:697)
    at runWithPriority$2 (react-dom.development.js:12149)
    at commitRoot (react-dom.development.js:24922)
    at finishSyncRender (react-dom.development.js:24329)
    at performSyncWorkOnRoot (react-dom.development.js:24307)
    at react-dom.development.js:12199
    at unstable_runWithPriority (scheduler.development.js:697)
    at runWithPriority$2 (react-dom.development.js:12149)
    at flushSyncCallbackQueueImpl (react-dom.development.js:12194)
    at flushSyncCallbackQueue (react-dom.development.js:12182)
    at discreteUpdates$1 (react-dom.development.js:24423)
    at discreteUpdates (react-dom.development.js:1438)
    at dispatchDiscreteEvent (react-dom.development.js:5881)

where index.js refers to index in build folder.

@agilgur5
Copy link
Owner

agilgur5 commented Dec 23, 2019

TypeScript support

TypeScript is not officially supported at this time. As I said before, please read the comments on #25. Please do not repeatedly spam.

I cannot comment or help with the type definitions of #21 given that they are unofficial and unsupported. You can seek help from users of that method on that issue. Otherwise, you can wait for official TypeScript support to make it into the library (please see #25 (comment) for some of that progress, will create some PRs in the near future. EDIT: see #42)

can't reproduce your error, which looks like a duplicate

With regard to the error you received, this is potentially a duplicate of #36. Like that issue, I am unable to reproduce this. All of the examples work fine, including the CodeSandbox playground and live demo

You'll have to provide a minimal reproduction or demo displaying this behavior, such as:

  • a CodeSandbox example (or equivalent) or
  • a screencapture of it at the demo site and the steps you took to reproduce it or
  • a failing test case. All tests currently pass.

Can re-open and analyze the issue once I can reproduce it.

Future Work

@agilgur5 agilgur5 added solution: can't repro An attempt to reproduce has been tried and failed solution: duplicate This issue or PR is a duplicate of another existing one solution: wontfix This will not be changed at this time labels Dec 23, 2019
@agilgur5 agilgur5 changed the title Cannot import after adding ts definition "h.default is not a constructor" error after adding unofficial TS definitions Dec 23, 2019
@agilgur5 agilgur5 added the scope: types Related to type definitions label Jan 21, 2020
@agilgur5 agilgur5 added the problem: stale Issue author has not responded label Mar 13, 2021
Repository owner locked as resolved and limited conversation to collaborators Mar 13, 2021
@agilgur5 agilgur5 changed the title "h.default is not a constructor" error after adding unofficial TS definitions h.default is not a constructor error after adding unofficial TS definitions Sep 17, 2022
@agilgur5 agilgur5 added the kind: support Asking for support with something or a specific use case label Sep 17, 2022
@agilgur5
Copy link
Owner

Otherwise, you can wait for official TypeScript support to make it into the library

v1.1.0-alpha.1 has been released as the first official native TS release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: support Asking for support with something or a specific use case problem: stale Issue author has not responded scope: types Related to type definitions solution: can't repro An attempt to reproduce has been tried and failed solution: duplicate This issue or PR is a duplicate of another existing one solution: wontfix This will not be changed at this time
Projects
None yet
Development

No branches or pull requests

2 participants