PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 27, 2022

[FIXED] How to run a three.js project locally from codesandbox

 November 27, 2022     codesandbox, module, three.js     No comments   

Issue

I found three.js project on codesandbox and I'm having trouble getting it to work locally.

On codesandbox it works normally https://codesandbox.io/s/github/jmswrnr/website-examples/tree/master/3d-header/final-result but when I downloaded the code from https://github.com/jmswrnr/website-examples/tree/master/3d-header/final-result and typed npm ci and then npx parcel index.html --open to start the server I got some errors which I couldn't fix. I also tried to run this project using webpack, parcel and vitejs and it also failed. I don't know what I am doing wrong, but I think there is a problem with importing modules. How can I run this project locally?


Solution

TLDR;

npm install --save @babel/compat-data
npm install --save parcel-bundler@1.12.3
npm start

FYI:
Please make sure to thoroughly Google the error before approaching Stackoverflow.

There were two errors thrown:
Cannot find module '/website-examples/3d-header/final-result/node_modules/@babel/compat-data/data/corejs3-shipped-proposals'
and
Cannot read properties of undefined (reading 'length') at lineCounter (/website-examples/3d-header/final-result/node_modules/parcel-bundler/src/utils/lineCounter.js:3:30)

Just Googling for parcel lineCounter led me to the Github issue as the first result: https://github.com/parcel-bundler/parcel/issues/2957



Answered By - Deep
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing