Skip to content

"TypeError: u is undefined" when useState called from CDN import #3586

Closed
@neverstew

Description

  • Check if updating to the latest Preact version resolves the issue

Describe the bug
When using the useState hook as imported from any CDN source, preact will crash and throw "TypeError: u is undefined".

To Reproduce
https://jsfiddle.net/vugyL4w9/

Expected behavior
I've taken the suggested jsfiddle from #2564 and adapted it so that we actually make use of the useState hook for a simple counter. I expected this to work.

I since tried swapping to pika and skypack as the module source, but both give the same error.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions