TweenJS import error: Cannot assign to read only property 'exports' of object '#<Object>'

300 Views Asked by At

I'm using NuxtJS with ThreeJS.

After I import TWEEN

import { TWEEN } from 'three/examples/jsm/libs/tween.module.min.js'

I get this error:

Cannot assign to read only property 'exports' of object '#<Object>'

Is there any workaround for this?

1

There are 1 best solutions below

0
MAZ On BEST ANSWER

At the end of the day, I used standalone tweenjs package and it worked :)

https://github.com/tweenjs/tween.js

Installed the package

npm i @tweenjs/tween.js@^18

Imported TWEEN

import * as TWEEN from '@tweenjs/tween.js'