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

Android: console: log functions fail in commonjs require

    Details

      Description

      [ERROR][TiJSError( 744)] (main) [0,1111] - Message: Uncaught ReferenceError: console is not defined
      [ERROR][TiJSError( 744)] (main) [0,1111] - Source:console.debug("drawAnnotation");

      Another Log:

      [ERROR][TiExceptionHandler(  656)] (main) [618,1470] ----- Titanium Javascript Runtime Error -----
      [ERROR][TiExceptionHandler(  656)] (main) [1,1471] - In require.js:1,1
      [ERROR][TiExceptionHandler(  656)] (main) [0,1471] - Message: Uncaught ReferenceError: console is not defined
      [ERROR][TiExceptionHandler(  656)] (main) [0,1471] - Source: console.log('require');
      [ERROR][V8Exception(  656)] Exception occurred at require.js:1: Uncaught ReferenceError: console is not defined
      

      seems like console works fine on IOS but throws errors on Android.

      Any console object calls in a commonjs module will fail on android, they work from app.js though.

      This is not a regression.

      Docs: http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Global.console

      Steps to Reproduce:

      1. Run code:

      require.js

      console.log('console.log');
      console.debug('console.debug');
      console.warn('console.warn');
      console.error('console.error');
      console.info('console.info');
      

      app.js

      require('require');
      

      Actual Result:

      Runtime error.

      Expected Result:

      Console message logged.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ayeung Allen Yeung
                Reporter:
                aaron@clearlyinnovative.com Aaron K. Saunders
                Tester:
                Lokesh Choudhary
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code