You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to little by little integrate some more modern web UI paradigms into a big, legacy web application. I'm currently evaluating Preact as a React alternative. This being an old web application, there's no build system to speak of, and I'm not planning to start by introducing that.
I'm trying to import Preact with hooks in an ES6 module that is loaded by the browser. The import statements look (as instructed in previous issues in this repo) like this:
import { h, render } from 'https://unpkg.com/preact@latest?module';
import { useState, useEffect } from 'https://unpkg.com/preact@latest/hooks/dist/hooks.module.js?module';
Actual Behavior
Unfortunately, when my browser loads this module, it errors out with a message:
TypeError: u is undefined
It's a bit hard to figure out what's going on since the code imported is minified. On the one hand, it does look like a genuine problem with the code. On the other hand, when I try the same import statements in e.g. CodePen it seems to work.
Any idea what I could be missing?
The text was updated successfully, but these errors were encountered:
Reproduction
I'm trying to little by little integrate some more modern web UI paradigms into a big, legacy web application. I'm currently evaluating Preact as a React alternative. This being an old web application, there's no build system to speak of, and I'm not planning to start by introducing that.
I'm trying to import Preact with hooks in an ES6 module that is loaded by the browser. The import statements look (as instructed in previous issues in this repo) like this:
Actual Behavior
Unfortunately, when my browser loads this module, it errors out with a message:
It's a bit hard to figure out what's going on since the code imported is minified. On the one hand, it does look like a genuine problem with the code. On the other hand, when I try the same import statements in e.g. CodePen it seems to work.
Any idea what I could be missing?
The text was updated successfully, but these errors were encountered: