fireship-io / threejs-scroll-animation-demo

3D Scrolling Portfolio Website with Three.js
1.49k stars 644 forks source link

Changes made in the source code doesn't affect the browser content. Three JS link problem. #7

Open PranavBhattarai opened 3 years ago

PranavBhattarai commented 3 years ago

My project directory is: /home/pranav/CodeSpace/Web/007

I followed all the instructions make in this video: https://www.youtube.com/watch?v=Q7AOvWpIVHU&t=196s

The only difference is the folder name, which is 007 in my case, and my project in your case.

image

I think there is a problem importing the three js libraries. I used this line import * as THREE from 'three'; to import.

And when I ctrl-click on three, it will jump and open a file named index.d.ts with this content:

image

Is this normal? On the browser side, my page does load, but it's all bank and white with the website header named "Pranav". Any modifications done in main.js are not being loaded. Why?

In index.html file I have use this technique which link the file. <script type="module" src='./main.js'></script> I wonder what's wrong.

dannycyph3r commented 1 year ago

I encountered the same issue, Found a solution for this?

bradene0 commented 1 year ago

Hello! I encountered this issue as well and after some brainstorming I found a small typo. I had put the canvas id outside the tags. I also changed my main.js link in the src tag to src = "../main.js". Hope this helps!