Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24674] Windows: require call in node_modules directory fails to find module

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2017-06-20T15:53:34.000+0000
Affected Version/sRelease 6.0.3
Fix Version/sRelease 6.2.0
ComponentsWindows
Labelsn/a
ReporterEwan Harris
AssigneeEwan Harris
Created2017-05-10T15:45:50.000+0000
Updated2017-08-16T16:54:55.000+0000

Description

Description

Carrying over from, TIMOB-24642. The demo app at https://www.dropbox.com/s/m4wy91x92gxw63m/demo.zip?dl=1 when built for windows will throw the error below, it seems to be unable to traverse back through to the top level node_modules to find bar
-- Start application log -----------------------------------------------------
[ERROR] Application Error: {
[ERROR]   "line": 2,
[ERROR]   "column": 10,
[ERROR]   "message": "require: Error while require(/app) require: Error while require(foo) require: Error while require(./lib/foo) require: Could not load module bar",
[ERROR]   "native_stack": [
[ERROR]     "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
[ERROR]   ]
[ERROR] }
-- End application log -------------------------------------------------------

Steps to reproduce

Download the above app

Build it for Windows

Actual

Error is thrown

Expected

No error thrown, console should log the below [INFO] boz index.js loaded [INFO] boo boo.js loaded [INFO] baz index.js loaded [INFO] bar bar.js loaded [INFO] foo lib/foo.js loaded [INFO] foo index.js loaded

Comments

  1. Ewan Harris 2017-05-12

    Master PR: https://github.com/appcelerator/titanium_mobile_windows/pull/998 [~emerriman] This is kinda a partner ticket to TIMOB-24642, but not as bad. Do we want to pull into 6.1.0 or am I too late?
  2. Samir Mohammed 2017-08-16

    Verified fix in SDK Version 7.0.0.v20170815065413 and SDK Version: 6.2.0.v20170815130745 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/998

JSON Source