How to import the PLYLoader in next.js app? ( with react-three-fiber )

I am developing an application to display .ply files on Next.js with react-three-fiber.
I refered below example, but when I try to import the PLYLoader, it throws an error. Does anyone know of a solution?

The example I refer to

How do I import:

import { PLYLoader } from 'three/examples/jsm/loaders/PLYLoader'


I’m afraid this is a very basic question.

three/jsm is untranspiled, it can’t run in node. we have made a mirror for module usage, tree-shaking and better dependency management GitHub - pmndrs/three-stdlib: Stand-alone library of threejs examples designed to run without transpilatio

import { PLYLoader } from 'three-stdlib'

this will universally help using three in node or ssr.

1 Like

Thanks for giving me a solution! It works!

Hey drcmda,

Can you email me at