V 28.7.0 Corrupted project file

Moved Support
  • Just had this nice new feature: During work bas IDE corrupted opened project. Few functions disappeared, body of one function moved to another place, appeared places with "Data corrupted" items. Several hours of work has completely gone.

  • @Danger-Lifter check "backup" folder for backups

  • Under what circumstances did this happen? Can this be repeated intentionally?

  • check "backup" folder for backups
    Thank you. Found

    Under what circumstances did this happen? Can this be repeated intentionally?

    Nothing special. Routine work, copy-paste, lag, empty screen in IDE, reload project.

  • @Danger-Lifter
    Was there a lot of action in the script panel at this point?

  • @m4zuper

    Was there a lot of action in the script panel at this point?

    Sorry, not sure what you mean here. If you mean number of functions in script then ~ 40. Nothing special.
    Probably you means actions in current edited function: also nothing special and really large. I do not think it was root of problem.
    Script has been living for a long time.

    Now I have new problem with that script. Script was fixed based on backup and compiled/installed in Bas as module. Now in Bas I see this module installed correctly, see all exported functions, can add "call" them into script, but... they do not work. Not one function from this module. On call error "ReferenceError: Can't find variable: ... ". I have other custom modules that were updated with latest Bas, installed and there is no problem to use/call them. What could be wrong with that module? I tried to check sources of module but at first glance do not see any differencesю

    I am familiar with js, So would be much appreciated any point what and which file in should I check to find a reason of the issue.

    Note, module itself works and normally runs in development/record mode. Issue is only if I try to call any exported function of this module on another script

  • ModeratorM Moderator moved this topic from Feedback on
  • I found that engine.js of the module contains wrong ")!" at the end of file:

     skiped...
    
          log('Total result items: ' + VAR_TOTAL_RESULT_ITEMS + ' on pages:' + VAR_TOTAL_RESULT_PAGES)
          if (typeof VAR_TOTAL_RESULT_PAGES === 'number') {
          VAR_RESULT.totalResultPages = VAR_TOTAL_RESULT_PAGES
          }
          if (typeof VAR_TOTAL_RESULT_ITEMS === 'number') {
          VAR_RESULT.totalResultItems = VAR_TOTAL_RESULT_ITEMS
          }
          VAR_RESULT.products = VAR_PRODUCTS
          if (!VAR_PRODUCTS.length && VAR_RESULT.totalResultItems) throw new Error('No products found')
          
    
          
          
          _function_return(VAR_RESULT)
          
    
       })!
    

    Removing manually those from engine.js makes it work. But I can't find a reason of those invalid chars in Module itself. Once you try compile and install module those "chars" appear again.

  • @Danger-Lifter
    Sorry for the long reply. What module are you talking about? Are you talking about the module you made yourself? Please attach the module files here or in a PM on the forum.

  • it also happen to me when using a very large node js script inside the embedded languages module
    better to keep it short probably