deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.45k stars 192 forks source link

Can't Open my Favorite File #1117

Open ianfreds opened 5 months ago

ianfreds commented 5 months ago

Stack:

LDtk version: 1.5.3-64bits
Cannot read properties of null (reading 'externalLevels')
TypeError
TypeError: Cannot read properties of null (reading 'externalLevels')
    at Object.cb (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:285488:8)
    at ui_modal_Progress.update (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:292554:8)
    at dn_Process._doMainUpdate (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:405:4)
    at dn_Process.updateAll (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:675:14)
    at Boot.update (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:5190:14)
    at Boot.mainLoop (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:5152:8)
    at hxd_System.browserLoop (file:///C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:190796:14)

Processes:

#0 App
 |--- #1 page.Home
 |--- #4 page.Home
 |--- #6 page.Home
#3 ui.modal.Progress
#5 ui.modal.dialog.LogPrint
#7 ui.modal.dialog.LogPrint

Log:



[BOOT]         App started
[BOOT]         Version: 1.5.3-64bits (build 473703)
[BOOT]         ExePath: C:/Users/ianfr/AppData/Local/Programs/ldtk
[BOOT]         Assets: C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets
[BOOT]         ExtraFiles: C:/Users/ianfr/AppData/Local/Programs/ldtk/extraFiles
[BOOT]         CWD: C:\Users\ianfr\AppData\Local\Programs\ldtk\
[BOOT]         Display: 1920x1080
[BOOT]         Args: soloValues=[], args=[]
[FILE]         Loading settings from C:/Users/ianfr/AppData/Roaming/LDtk/settings...
[BOOT]         AppZoomFactor: 1
[BOOT]         Calling appReady...
[UPDATE]       Looking for update
[BOOT]         Start args: path=null levelIndex=null
[BOOT]         Loading Home...
[GENERAL]      Page started: page.Home()
[FILE]         Loading page template: home from C:/Users/ianfr/AppData/Local/Programs/ldtk/resources/app.asar/assets/tpl/pages/home.html
[DEBUG]        samplesDir=C:/Users/ianfr/AppData/Local/Programs/ldtk/extraFiles/samples
[GENERAL]      Progress created.
[GENERAL]      Progress started: : "docks_sample.ldtk: Project...", 5 operation(s)
[LOAD]         Loading project docks_sample.ldtk...
[ERROR]        SyntaxError: Unexpected token '
Falconerd commented 3 weeks ago

Did you ever solve this? I'm having this issue suddenly... I haven't changed anything and my game can still load the .ldtk file just fine.

ianfreds commented 3 weeks ago

No, I ended up remaking the file from scratch (and made lots of local backups the second time around)

deepnight commented 3 weeks ago

Hi, I'm sorry you ended up losing your work. Corrupted files usually happen if the saving operation is interrupted in some way, like the LDtk json file being read while being written.

I highly recommend enabling project backups in your Project Settings:

image

It will then be easy to restore a recent backup (one is done on every successful save):

image

ianfreds commented 3 weeks ago

Thanks for the tip!