infernojs / inferno

:fire: An extremely fast, React-like JavaScript library for building modern user interfaces

Home Page:https://infernojs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inferno 7.4.8, TypeError: n.getFlagsForElementVnode is not a function

iambumblehead opened this issue · comments

Using inferno from a CDN results in this error TypeError: n.getFlagsForElementVnode is not a function

<script src="https://unpkg.com/inferno-hyperscript@7.4.8/dist/inferno-hyperscript.js"></script>
<script src="https://unpkg.com/inferno-hyperscript@7.4.8/dist/inferno-hyperscript.min.js"></script>
const { h, render } = window.Inferno;

window.onload = () => {
    render( h( 'div', 'hello!' ), document.body );
    // Uncaught TypeError: n.getFlagsForElementVnode is not a function
};

I tested this and its working as expected. Did you remember to load inferno script in your html file?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>inferno</title>
    <script src="https://unpkg.com/inferno@7.4.8/dist/inferno.js"></script>
    <script src="https://unpkg.com/inferno-hyperscript@7.4.8/dist/inferno-hyperscript.js"></script>
</head>
<body>

</body>

<script>
    const { h, render } = window.Inferno;

    window.onload = () => {
        render( h( 'div', 'hello!' ), document.body );
    };
</script>
</html>

@Havunen thank you and I'm sorry if I've wasted your time here -- I think you are right and I will try it out in a moment and let you know how it goes

@Havunen yes my attempt was wrong -- everything is working thank you