{ "id": "154058", "key": "TIMOB-20346", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2016-02-10T04:45:59.000+0000", "created": "2015-12-29T08:17:21.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-04-04T15:08:52.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "Lets take a practical example: we use `mocha.js` using npm, but as soon as we try to compile the project, it fails because of some JS syntax error in the `tests` directory of this module (for instance, I got an error like ' # is not a valid expression', or something related).\r\n\r\nMy npm modules reside in `app/lib/node_modules/..` so I can access them in my app. I have another node_modules in the root of my project, for modules like `Grunt` (since those didnt compile either because of the JS checking) and I dont need those in the runtime.\r\n\r\nPlease do not suggest ti-mocha since that is not the issue here.", "attachment": [], "flagged": false, "summary": "Cant load certain NPM modules because of Syntax", "creator": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "environment": "Any Titanium/Alloy environment, any platform", "comment": { "comments": [ { "id": "373594", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "error example:\r\n\r\n\r\n{code:text}\r\n[ERROR] : Error generating AST for \"**somepath**/*.js\"\r\n[ERROR] : Unexpected character '#'\r\n[ERROR] : line 1\r\n{code}\r\n", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-29T08:21:01.000+0000", "updated": "2015-12-29T08:21:31.000+0000" }, { "id": "373600", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, If you don't actually show a simple test case (not your whole app) we can't run that exhibits the problem, the best anyone can do is make guesses. AST errors will generally tell you exactly what line and in what file they occur in. That should show you exactly where the error in your code is. Again, the best anyone can do is guess based on the single line of error log you provided and the fact that you haven't yet shared the full error output.\r\n\r\nSo, Provide a sample test case which causing the error. Provide full platform information and component versions. Provide the full error log. And descrive the problem thoroughly. Thanks.\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2015-12-29T11:41:05.000+0000", "updated": "2015-12-29T11:41:05.000+0000" }, { "id": "374932", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "Do you even read bug reports?\r\n\r\nJust make a js-file somewhere in your app directory so it gets compiled when you build the app. Make sure the file starts with \r\n{code:java}\r\n#!/usr/bin/env node\r\n{code}\r\nor some other expression with a pound/hash-symbol. Basically loading a specific NPM module causes the same issue since that just downloads a pack of js-files into your app.\r\n\r\nAlthough this is not valid javascript, a lot of npm modules use this notation for some unix reason. It cant be compiled by uglify. A solution here would be that you can ignore specific files by just copying them over instead of compiling them.", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2016-01-20T11:38:10.000+0000", "updated": "2016-01-20T11:38:39.000+0000" }, { "id": "375048", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "I tried your way. I created a js file with the name of \"#test.js\". I put it on the resource directory. The app compiles fine. No Error or exceptions. Tested with SDK 5.1.2.GA. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-01-21T06:05:23.000+0000", "updated": "2016-01-21T06:05:23.000+0000" }, { "id": "375998", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "yes you dont read bug reports carefully.\r\n\r\nNow Try again with the line:\r\n\r\nTESTCASE (put this in any .js file on the 1st line for instance):\r\n{code}\r\n#!/usr/bin/env node --expose_gc\r\n{code}\r\n\r\nThis is used in quite some npm modules and it prevents us from compiling.\r\n\r\nThanks.", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2016-02-04T08:16:33.000+0000", "updated": "2016-02-04T08:16:33.000+0000" }, { "id": "376460", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Titanium only supports standard JavaScript files. Files that begin with a shebang/hashbang are not standard JavaScript files.\r\n\r\nThe shebang is a Unix-specific character sequence that is not supported by ECMAScript standard.\r\n\r\nWe have no plans to support this. You will need to strip the shebang line, remove the .js extension, or remove the file altogether.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-02-10T04:45:59.000+0000", "updated": "2016-02-10T04:45:59.000+0000" }, { "id": "415467", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as Won't Fix with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T22:36:33.000+0000", "updated": "2017-03-23T22:36:33.000+0000" }, { "id": "416714", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-04-04T09:02:12.000+0000", "updated": "2017-04-04T09:02:12.000+0000" }, { "id": "416741", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~uzbbert] Well, Uglify is only part of the problem. I reiterate my comment above. I will take a look at ALOY-1540.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-04T15:08:52.000+0000", "updated": "2017-04-04T15:08:52.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }