TeamMaestro / angular-native-seed

Build web apps and NativeScript applications from one codebase using the AngularCLI.
265 stars 71 forks source link

Cannot find module './app/app.module' #83

Open mr-White opened 6 years ago

mr-White commented 6 years ago

Did a fresh install twice in different folders to try both Node v8.9.4 and Node v6.13.0 using nvm for Windows (Win 10 64-bit).

In both cases, I got the same error about a missing ./app/app.module. I thought maybe it has something to do with the build process or maybe a package.json file was missing the main property being set. I don't know. I'm pretty new to NativeScript...

However, a fresh install of an App Template from NativeScript (the one with the drawer) works so if there is anything I can do to help with this, let me know! I'm really interested in this repo. Thanks for all the hard work thus far!!

Here's the error:

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error: com.tns.NativeScriptException: Failed to find module: "./app/app.module", relative to: app/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:504)
    com.tns.Runtime.run(Runtime.java:499)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    android.app.ActivityThread.-wrap2(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.domain.project/files/app/main.js', line: 4, column: 20
    Frame: function:'require', file:'', line: 1, column: 266

Error: com.tns.NativeScriptException: Failed to find module: "./app/app.module", relative to: app/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:504)
    com.tns.Runtime.run(Runtime.java:499)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    android.app.ActivityThread.-wrap2(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.domain.project/files/app/main.js', line: 4, column: 20
    Frame: function:'require', file:'', line: 1, column: 266

    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
    at android.app.ActivityThread.-wrap2(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.tns.NativeScriptException: 

Error calling module function 

Error: com.tns.NativeScriptException: Failed to find module: "./app/app.module", relative to: app/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:504)
    com.tns.Runtime.run(Runtime.java:499)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    android.app.ActivityThread.-wrap2(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.domain.project/files/app/main.js', line: 4, column: 20
    Frame: function:'require', file:'', line: 1, column: 266

Error: com.tns.NativeScriptException: Failed to find module: "./app/app.module", relative to: app/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:504)
    com.tns.Runtime.run(Runtime.java:499)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    android.app.ActivityThread.-wrap2(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.domain.project/files/app/main.js', line: 4, column: 20
    Frame: function:'require', file:'', line: 1, column: 266

    at com.tns.Runtime.runModule(Native Method)
    at com.tns.Runtime.runModule(Runtime.java:504)
    at com.tns.Runtime.run(Runtime.java:499)
    at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
    ... 8 more
sean-perkins commented 6 years ago

Can you check with the latest in master and let me know if you still have problems?

ghost commented 6 years ago

i got the latest and i am getting same issue

lyuboasenov commented 6 years ago

the symlink in {root}/nativescript/src to {root}/src/app is broken. Rebuild the symlink and you should be good to go.