Skip to content

AssetWatcher throws an error when spine is exporting files #159

@CyberDex

Description

@CyberDex
file:///node_modules/@assetpack/core/dist/core/AssetWatcher.js:147
            else if (asset.state === 'normal') {
                           ^

TypeError: Cannot read properties of undefined (reading 'state')
    at file:///node_modules/@assetpack/core/dist/core/AssetWatcher.js:147:28
    at Array.forEach (<anonymous>)
    at AssetWatcher._applyChangeToAssets (file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:124:17)
    at AssetWatcher._updateAssets (file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:118:14)

Node.js v22.17.0
file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:128
                asset.state = 'deleted';
                            ^

TypeError: Cannot set properties of undefined (setting 'state')
    at file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:128:29
    at Array.forEach (<anonymous>)
    at AssetWatcher._applyChangeToAssets (file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:124:17)
    at AssetWatcher._updateAssets (file:///Users/dex/Dev/mrQ/goosicorn-racing/node_modules/@assetpack/core/dist/core/AssetWatcher.js:118:14)

Node.js v22.17.0

When the Spine editor exports files, it sometimes rewrites them multiple times.
So AssetWatcher reacts to the first file update and starts _applyChangeToAssets,
But in parallel, those files are changed again by the Spine editor, which causes an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions