zepeto-studio-kor icon indicating copy to clipboard operation
zepeto-studio-kor copied to clipboard

[BUG] : I am getting an error Cannot read property 'exports' of undefined

Open Cha-SeongHun opened this issue 2 years ago • 2 comments

Please tell us the version of the ZEPETO World package. (You can check the version in Unity > Window > Package Manager.) 1.4.1

Please tell us which version of the ZEPETO app is currently installed. (You can check the version in ZEPETO App > MY > Settings > Version.) 3.13.5

What features were you trying to implement?

What problem did you encounter?

An error occurs even though there is no syntax error in typescript. The symptom is that when the Play button is pressed, an error message appears and the game cannot be played. The error message is as below.

//Cannot read property 'exports' of undefined

Please tell us your development environment. Window 11 Android 12

Please attach the implemented code. If you have a screenshot, please attach it. image

The code I used is below.

import { Vector2 } from "UnityEngine";

export default class SplineUtility {
    public static CatmullRom2D(t: float, prevAnchor: Vector2, prev: Vector2, next: Vector2, nextAnchor: Vector2): Vector2 {
        const t2: float = t * t;
        const t3: float = t2 * t;
        const a: Vector2 = 2.0 * prev;
        const b: Vector2 = next - prevAnchor;
        const c: Vector2 = 2.0 * prevAnchor - 5.0 * prev + 4.0 * next - nextAnchor;
        const d: Vector2 = prevAnchor * -1.0 + 3.0 * prev - 3.0 * next + nextAnchor;

        //The cubic polynomial: a + b * t + c * t^2 + d * t^3
        return 0.5 * (a + b * t + c * t2 + d * t3);
    }
}

Cha-SeongHun avatar Jun 13 '22 08:06 Cha-SeongHun

증상을 보면 조금이라도 복잡한 Vector2, Vector3 연산이 들어가면 발생하는 것으로 추정됩니다.

Cha-SeongHun avatar Jun 13 '22 08:06 Cha-SeongHun

안녕하세요, 이슈 확인해 보니 현재 코드에서는 Vectro2 연산의 number * Vector2 연산처리를 하면서 발생하는 이슈로 확인 되었습니다. 현재 버전에서는 Vector2 * number 로 바꾸면 에러를 회피할 수 있습니다. Vector2 연산의 교환법칙이 성립하도록 수정할 예정이며 시간은 다소 소요될 것 같습니다. 감사합니다.

Zepeto-TechEvangelist avatar Jun 14 '22 09:06 Zepeto-TechEvangelist