Skip to content

icosahedron example - newer versions will not run. #15

Open

Description

@Neon22

Tried updating to three.js version 162 using cdjns published url:

<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.162.0/three.module.min.js"></script>

However get error message:

ImportError: cannot import name 'THREE' from 'js' (unknown location)

I am not sure if this is happening because of order of imports (and three is not loaded but the older 147 is loaded), or of a change made between builds 147 and 162 in three.js itself.
Also unsure if doing it like this is preferred now or should it be in toml file ?

Hoping you can help and update the examples.

Activity

  1. Neon22 commented on Mar 23, 2024

    @Neon22
    ContributorAuthor

    more info:
    Apparently this is the official response:
    googlemaps/js-three#261

    However I don't know enough to fix in pyscript.

  2. Neon22 commented on Mar 23, 2024

    @Neon22
    ContributorAuthor

    We probably also want to be able to import the addons/ e.g. for orbit controls.
    I am hoping the example could also include one of these ?

  3. Neon22 commented on Mar 24, 2024

    @Neon22
    ContributorAuthor

    Looks like it was announced in 2024.1.1

    <py-config>
        [js_modules.main]
        "https://cdn.jsdelivr.net/npm/fireworks-js@2.10.7/+esm" = "Fireworks_Module"
    </py-config>
    <script type="py">
        from pyscript.js_modules import Fireworks_Module
    ...
    

    Alas adding this to the toml file does work:

    [js_modules.main]
        "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.162.0/three.module.min.js" = "THREE"
    

    as does this:
    "https://cdn.jsdelivr.net/npm/three@0.162.0/+esm"

  4. Neon22 commented on May 7, 2024

    @Neon22
    ContributorAuthor

    As of new examples release. Still using "three.js/0.147.0"
    Latest as of today is 164.

    17 releases behind and cannot use.

    This example needs to be updated:

    OK. looks like this entire repo is no longer being used anymore (still linked to src="https://pyscript.net/releases/2024.1.1/core.js" in html file).

    SO - going to try to find where you're pulling the examples from and repost this issue there.
    Will also suggest you delete this repo.

  5. Neon22 commented on Jun 26, 2024

    @Neon22
    ContributorAuthor

    Three.js now at version 165.
    The icosahedron example is "27" releases behind :(

  6. Neon22 commented on Feb 5, 2025

    @Neon22
    ContributorAuthor

    Andrea has made adjustments to the example for next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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