GeorgeHastings / embed-unicornstudio

https://embed-unicorn-studio.vercel.app
6 stars 0 forks source link

I found An error "Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D" occurred #2

Closed usaci closed 1 week ago

usaci commented 2 weeks ago

Hello. I tried to embed my unicorn.studio project in HTML, but I found an error occurred as below.

Uncaught (in promise) TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
    at _e (unicornStudio.umd.js:49:28277)
    at Pt.render (unicornStudio.umd.js:49:43565)
    at Pt.unpackage (unicornStudio.umd.js:49:41941)
    at unicornStudio.umd.js:49:30273
    at Array.forEach (<anonymous>)
    at ft (unicornStudio.umd.js:49:30049)
    at unicornStudio.umd.js:52:19272.

And I attach index.html.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.unicorn.studio/v1.3.0/unicornStudio.umd.js"></script>
</head>
<body>
    <div
    class="unicorn-embed"
    data-us-project="MY-PROJECT-ID"
    data-us-scale="1"
    data-us-dpi="1.5"
    data-us-lazyload="true"
    data-us-disableMobile="true"
    data-us-alttext="Welcome to Unicorn Studio"
    data-us-arialabel="This is a canvas scene"
    ></div>
    <script>
    UnicornStudio.init()
        .then((scenes) => {
        // Scenes are ready
        })
        .catch((err) => {
        console.error(err);
        });
    </script>
</body>
</html>
elliottmangham commented 2 weeks ago

@usaci I tested your example with a test project, and it worked fine with no errors. See the screenshot below. If you need more assistance from the author, it would be helpful to include your specific browser and OS information, as well as your project ID or code, as this may be a specific issue.

CleanShot 2024-09-19 at 1  51 37@2x

GeorgeHastings commented 2 weeks ago

@usaci I think this was fixed a couple days ago. please let me know if you see it again.