[AC-5955] Changes to the .js file in app>conroller folder not getting reflected
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Invalid |
Resolution Date | 2018-10-14T22:08:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | JATIN JOSHI |
Assignee | Shak Hossain |
Created | 2018-10-04T15:21:03.000+0000 |
Updated | 2018-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
[~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:"?
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
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), whereasrequire('/database')
will work if the file resides under theapp/lib
folder in an Alloy app[~mr.jatinjoshi.mca@gmail.com] did the
require('/database')
work?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.
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.
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.