Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5955] Changes to the .js file in app>conroller folder not getting reflected

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionInvalid
Resolution Date2018-10-14T22:08:39.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterJATIN JOSHI
AssigneeShak Hossain
Created2018-10-04T15:21:03.000+0000
Updated2018-10-14T22:08:39.000+0000

Description

Steps to Reproduce

I am having a Titanium project in which I am making changes in .js file in app>> controller>>lib folder. After making changes it should reflect the changes, when I run the app, but it is not. At the same time, other team member is making change to the same code on his machine, it works. I even did the project clean, but issue remains

Actual Result

As recommened instead of var dbLib = require('database'); used var dbLib = require('./database'); Getting error [ERROR] : Script Error { [ERROR] : column = 20; [ERROR] : line = 15; [ERROR] : message = 'undefined is not an object (evaluating 'db.getIsLoading')';

Expected Result

Change to database.js file in app>>controller>>lib folder must not show the error.

Attachments

FileDateSize
.log2018-10-04T15:21:04.000+0000243801
diagnostic6236905944435787733.log2018-10-04T15:21:29.000+00002819858

Comments

  1. Ewan Harris 2018-10-04

    [~mr.jatinjoshi.mca@gmail.com] What do you mean by "As recommened instead of", do you mean logging from the SDK like "require called with un-prefixed module id:"?
  2. JATIN JOSHI 2018-10-04

    I meant, as recommended by Appcelerator in the logs: [WARN] : The requested path 'database' has a collison between a native Titanium API/module and a JS file. [WARN] : The native Titanium API/module will be loaded in preference. [WARN] : If you intended to address the JS file, please require the path using a prefixed string such as require('./database') or require('/database') instead. I upgraded the app from SDK 5.5.1 to SDK 7.4.0
  3. Ewan Harris 2018-10-04

    Have you tried the second require require('/database') in that log? The one you're using will try to require the file relative the file you're using (so if it's in the same directory it will succeed), whereas require('/database') will work if the file resides under the app/lib folder in an Alloy app
  4. Ewan Harris 2018-10-05

    [~mr.jatinjoshi.mca@gmail.com] did the require('/database') work?
  5. JATIN JOSHI 2018-10-08

    No. I have been trying to rebuild the app, but no changes, that I can see it on front end. Project was developed by previous developer and code was checked in github. I pulled that code and then imported into appcelerator and then ran. Got the message, Resources folder missing. I asked for the Resources folder from that developer and placed in the root folder, but still no changes are reflected. If I a make any change in the Resource folder files, that shows, but making change in views of controller file of the project, no changes are seen.
  6. Sharif AbuDarda 2018-10-08

    Hello [~mr.jatinjoshi.mca@gmail.com], What happens if you make changes in js file and after saving, try running the project through terminal? Thanks.
  7. JATIN JOSHI 2018-10-09

    This issue is fixed: Don't know how but when I deleted the Resources folder and again compiled the project by using: appc alloy compile --config platform=ios It recreated the Resources folder and project started working and my changes were reflected.

JSON Source