Error then i try build next js app

When I try to build the nextjs application I get an error –
ReferenceError: ProgressEvent is not defined
at /Users/admin/Documents/dev/hip-wrap/node_modules/three/build/three.cjs:26117:24
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.0
[====] info - Generating static pages (7/8)/Users/admin/Documents/dev/hip-wrap/node_modules/three/build/three.cjs:26117
const event = new ProgressEvent(‘progress’, {
^
ReferenceError: ProgressEvent is not defined
at /Users/admin/Documents/dev/hip-wrap/node_modules/three/build/three.cjs:26117:24
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.0

Build error occurred
Error: Call retries were exceeded
at ChildProcessWorker.initialize (/Users/admin/Documents/dev/hip-wrap/node_modules/next/dist/compiled/jest-worker/index.js:1:11661)
at ChildProcessWorker._onExit (/Users/admin/Documents/dev/hip-wrap/node_modules/next/dist/compiled/jest-worker/index.js:1:12599)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:489:12)
at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
type: ‘WorkerError’

Be sure to not server-side render any pages using three - unless something changed recently, three is not compatible with nextjs SSR:

import dynamic from 'next/dynamic';

const _Component = () => {
  // NOTE Use three here
};

export const Component = dynamic(() => Promise.resolve(_Component), {
  ssr: false
});