Add threejs on basic page

HI everyone

I realize this page


i have this file

I don t understand the message of error
can I have some explication thanks

Maybe into index.html script without type="module" also need for file three.core.min.js
Show index.html code

thanks for your message

my code


I add the file here

I add module but still have the message of error

I made mistake. You need also three.module.js and path must be to it.

<body>
<script type="importmap">
{
"imports": {
"three": "./three.module.js",
"three/addons/": "./jsm/"
}
}
</script>
<script type="module" src=./main.js"></script>
</body>

what I have now



but still have

Can you send archive to messages. i will check at self

what you want said by archive the file ???

rar or zip archive with all files

ok i will send it

this the zip file
web.zip (210.5 KB)

and this is the course

https://www.mediafire.com/file/wbccx3c4ewurd5z/lesson3_1GKE6bUR.mp4/file

You forgot delete line:

Fixed index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <script type="importmap">
        {
        "imports": {
        "three": "./three.module.min.js",
        "three/addons/": "./jsm/"
        }
        }
        </script>
    <script type="module" src="./main.js"></script>
</body>
</html>

Now you need file three.module.min.js instead three.module.js.
Now its works ok.

I don’t really understand your message

my html should be like this:

<body>
    

    <script type="importmap">
        {
        "imports": {
        "three": "./three.module.js",
        "three/addons/": "./jsm/"
        }
        }
        </script>

   <script src="three.module.js"></script>
   <script src="three.module.min.js"></script>
    <script type="module" src="main.js"></script>
</body>```


I should remove 
three.core.min.js

the file I have

the code

the message

Paste it in index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
<body>
    <script type="importmap">
        {
        "imports": {
        "three": "./three.module.min.js",
        "three/addons/": "./jsm/"
        }
        }
        </script>
    <script type="module" src="./main.js"></script>
</body>
</html>

Files:

this

<body>
    

    <script type="importmap">
        {
        "imports": {
        "three": "./three.module.js",
        "three/addons/": "./jsm/"
        }
        }
        </script>
  
   
   <script src="three.core.min.js"></script>
   <script src="three.module.min.js"></script>
    <script type="module" src="main.js"></script>
</body>```

I have this

We already define three.module.js into importmap
Delete this lines:

<script src="three.core.min.js"></script>
<script src="three.module.min.js"></script>

Into main.js we have line:
import * as THREE from 'three';
It load file three.module.min.js which load also file three.core.min.js

ok now I have