GithubHelp home page GithubHelp logo

Comments (5)

gisfinder avatar gisfinder commented on June 30, 2024

the source file "vendor/three/build/three.module.js" is wrong.

from discoverthreejs-site.

pflagerd avatar pflagerd commented on June 30, 2024

I agree that the source file "vendor/three/build/three.module.js" looks wrong. It looks like html. But I cannot find where it is referenced in the source code anywhere. In fact, after finding a fix for the cdn.skypack.dev version problem, I removed the vendor/ directory entirely and suffered no ill effects. Code appeared to work the same.

from discoverthreejs-site.

pflagerd avatar pflagerd commented on June 30, 2024

I found that if I replaced 0.136.2 with 0.149.0, I could run MOST of the code examples. However, I also found a compatibility problem with the import in the controls.js file of those code examples that have controls.js (not all do).

import { OrbitControls} from 'https://cdn.skypack.dev/[email protected]/examples/jsm/controls/OrbitControls.js';

causes a Chrome/Chromium 118.0.5993.88 browser instance to complain in its console (and no scene is displayed) thus:

Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".

Seems that the problem is somewhat unique to cdn.skypack.dev as replacing it with esm.sh or jspm.dev in the offending import results in the scene being correctly displayed.

e.g.

import { OrbitControls} from 'https://esm.sh/[email protected]/examples/jsm/controls/OrbitControls.js';

from discoverthreejs-site.

pflagerd avatar pflagerd commented on June 30, 2024

I guess I will work on replacing cdn.skypack.dev and changing the version number to 0.149.0 in my fork.

It would probably be wise to make it clear in the text of the site and/or the code examples themselves that we are using 0.149.0 which is not the most recent version.

from discoverthreejs-site.

pflagerd avatar pflagerd commented on June 30, 2024

Also begs the question "How about examples which use the npm import style for running locally?"

from discoverthreejs-site.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.