Skip to content

ReferenceError: Cannot access 'thisLayer' before initialization #7

@coeing

Description

@coeing

Hi there,

Thanks for providing this package, it makes developing After Effects libraries with TypeScript much easier :)

Unfortunately I get an error when importing the package inside Jest unit tests:

ReferenceError: Cannot access 'thisLayer' before initialization

Having a look at your code I saw that you define thisLayer after the declaration of the Layer class, but thisLayer is also used to set the parent of a layer in the Layer constructor (line 851 in index.js). This seems to cause the error.

I am using your template create-expression-lib where Jest unit tests are included. In the index.test.ts file you are mocking this package, but from the docs this should not be necessary: https://github.com/motiondeveloper/create-expression-lib#testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions