Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25790

iOS: Liveview broken when transpiling code

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.1.0, Release 7.2.0
    • Fix Version/s: None
    • Component/s: iOS, LiveView
    • Labels:
      None
    • Environment:

      Ti SDK: 7.2.0.v20180219091800, 7.1.0.v20180219033455
      iOS 11 .1 simulator

      Description

      Description

      Using liveview with the <transpile> flag in the tiapp set to true (or not in the tiapp as it defaults to true) currently throws the below error link to source

      • This occurs because the liveview code is attempting to overwrite the global.L variable, globals are defined as readOnly see here and as all code in now run in strict mode this is now an error (credit to TIMOB-18465 for helping me figure this one out)

      There's two ways we can fix this

      1. Remove kTiPropertyAttributeReadOnly on global properties
      2. Stop making all JS core run in strict mode by default by adding modules: false to the object passed to preset-env, which will have a knock on effect to ES6 module support

      My vote goes for 1, but again this highlights the fact the transpilation step is going to cause breaking changes for people

      [ERROR] Script Error {
      [ERROR]     column = 12;
      [ERROR]     line = 427;
      [ERROR]     message = "Attempted to assign to readonly property.";
      [ERROR]     sourceURL = "file:///Users/eharris/Library/Developer/CoreSimulator/Devices/19A348C6-7F86-4096-AEDE-90BB291BC971/data/Containers/Bundle/Application/D00FE479-9C4B-4ECD-84B6-1C1790C822FE/ticreateapp.app/app.js";
      [ERROR] }
      

      Steps to reproduce
      1. Enable transpilation by adding the <transpile>true</transpile> flag to your tiapp.xml
      2. Build an app using liveview to iOS
      Actual

      Error above is thrown

      Expected

      No error thrown, liveview should work as normal

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eharris Ewan Harris
                Reporter:
                eharris Ewan Harris
                Reviewer:
                Christopher Williams
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6191
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code