Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6492] Hyperloop: weird behavior compiling a project with LiveView enabled

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsHyperloop
Labelshyperloop, ios
ReporterAndrea Vitale
AssigneeAbir Mukherjee
Created2020-02-19T14:40:55.000+0000
Updated2020-02-26T05:03:10.000+0000

Description

Compiling a project with Hyperloop and LiveView doesn't work as expected. Here is my code:
import { UIView, UIColor, UIBezierPath } from 'UIKit';
import { CAShapeLayer } from 'QuartzCore';
import { CoreGraphics } from 'CoreGraphics';

module.exports = {
    createPanelView: function(creationArgs) {
        const container = Ti.UI.createView(creationArgs);
        const panel = UIView.cast(container);
This is working fine *without* LiveView. Cleaning the project and running it *with* LiveView enabled gives this error:
[ERROR] TypeError: (0, _UIKit.UIView) is not a function. (In '(0, _UIKit.UIView)()', '(0, _UIKit.UIView)' is undefined)
[ERROR] File: app.js
[ERROR] Line: 10
[ERROR] SourceId: undefined
[ERROR] Backtrace:
[ERROR]  undefined
If I clean the project, I recompile it *without* LiveView and restart it *with* LiveView (without cleaning it before) everything is working as expected.

Comments

  1. Rene Pot 2020-02-19

    Does the require notation work?
       const UIView = require('UIKit/UIView');
       
  2. Andrea Vitale 2020-02-19

    Yes, using require it works as expected.
  3. Rene Pot 2020-02-19

    Good to know! I found the same as well but perhaps it was a local problem. I guess it is a transpile problem, and as a workaround you could use the require methods for now.

JSON Source