Import not found - marching cubes

Hello,

I have a problem where I try to import the marching cubes effect from the three js master file but when I check the console for errors it says ‘import not found: marching cubes’ I have tried everything and can’t figure out what’s wrong, please help.

Please see my code here: GitHub - Shange-Fagan/shange.github.io: My Website

Many Thanks

import { MarchingCubes } from './js/MarchingCubes.js';

The above line is a ES6 module import.

./js/MarchingCubes.js is not a ES6 module. Hence the runtime error.

It’s sufficient if your import the file via <script src="js/MarchingCubes.js"></script> what you already do in your code. However, you have to access MarchingCubes over the THREE namespace in the same way you work with OrbitControls.

1 Like

Thanks so much I have fixed the problem now but now it says ‘missing ) after formal parameters’ line: 195, GitHub - Shange-Fagan/shange.github.io: My Website my main goal here is to replicate the Marching cubes effect that can be seen on the three js examples website: three.js examples , what’s the best way to do this?

Many Thanks again

There is a syntax error here:

sorry, I am extremely new to three js and coding in general, what is the error?