Home > Software design >  TweenJS import error: Cannot assign to read only property 'exports' of object '#<O
TweenJS import error: Cannot assign to read only property 'exports' of object '#<O

Time:07-02

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?

CodePudding user response:

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'
  • Related