0

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?

Sp4rq
  • 31
  • 5

1 Answers1

0

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

Deep
  • 532
  • 3
  • 10