Skip to content

Seems {N} won't include @namespace node_modules #2257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
enchev opened this issue Nov 25, 2016 · 5 comments
Closed

Seems {N} won't include @namespace node_modules #2257

enchev opened this issue Nov 25, 2016 · 5 comments
Assignees
Labels
Milestone

Comments

@enchev
Copy link
Contributor

enchev commented Nov 25, 2016

From @pocesar on November 10, 2016 11:14

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.3.0
  • Cross-platform modules: 2.3.0
  • Runtime(s): 2.3.0
  • Plugin(s): (look for the version number in the package.json file of your
    project)

Please tell us how to recreate the issue in as much detail as possible.

in package.json

{
  "dependencies": {
    "@google/maps": "^0.3.0"
  }
}

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

When I try to import it from code:

import { createClient } from '@google/maps'
import * as bluebird from 'bluebird'

export function gmapsClient() {
    return createClient({
        key: config.api,
        Promise: bluebird
    })
}

it crashes with:

JS: ��Unhandled rejection Error: com.tns.NativeScriptException: Failed to find module: "@google/maps", relative to: /app/tns_modules/
JS:     com.tns.Module.resolvePathHelper(Module.java:220)
JS:     com.tns.Module.resolvePath(Module.java:60)
JS:     com.tns.Runtime.callJSMethodNative(Native Method)
JS:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:865)
JS:     com.tns.Runtime.callJSMethodImpl(Runtime.java:730)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:716)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:697)
JS:     com.tns.Runtime.callJSMethod(Runtime.java:687)
JS:     com.tns.gen.java.lang.Runnable.run(java.lang.Runnable.java)
JS:     android.os.Handler.handleCallback(Handler.java:725)
JS:     android.os.Handler.dispatchMessage(Handler.java:92)
JS:     android.os.Looper.loop(Looper.java:137)
JS:     android.app.ActivityThread.main(ActivityThread.java:5041)
JS:     java.lang.reflect.Method.invokeNative(Native Method)
JS:     java.lang.reflect.Method.invoke(Method.java:511)
JS:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
JS:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
JS:     dalvik.system.NativeStart.main(Native Method)
JS:     at Error (native)
JS:     at require (<anonymous>:1:266)
JS:     at Object.<anonymous> (/data/data/org.nativescript.cadastramento/files/app/models/common.js:2:14)
JS:     at require (<anonymous>:1:266)
JS:     at Object.<anonymous> (/data/data/org.nativescript.cadastramento/files/app/views/actions.js:4:16)
JS:     at require (<anonymous>:1:266)
JS:     at global.loadModule (/data/data/org.nativescript.cadastramento/files/app/tns_modules/globals/globals.js:29:31)
JS:     at resolvePageFromEntry (/data/data/org.nativescript.cadastramento/files/app/tns_modules/ui/frame/frame-common.js:79:40)
JS:     at Frame.navigate (/data/data/org.nativescript.cadastramento/files/app/tns_modules/ui/frame/frame-common.js:165:20)
JS:     at /data/data/org.nativescript.cadastramento/files/app/views/main.js:30:25
JS:     at tryCatcher (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/util.js:16:23)
JS:     at Promise._settlePromiseFromHandler (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/promise.js:510:31)
JS:     at Promise._settlePromise (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/promise.js:567:18)
JS:     at Promise._settlePromise0 (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/promise.js:612:10)
JS:     at Promise._settlePromises (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/promise.js:691:18)
JS:     at Promise._fulfill (/data/data/org.nativescript.cadastramento/files/app/tns_modules/bluebird/js/release/promise.js:636:18)

it seems that {N} is ignoring the @google/maps package

Copied from original issue: NativeScript/NativeScript#3059

@enchev
Copy link
Contributor Author

enchev commented Nov 25, 2016

From @Pip3r4o on November 10, 2016 12:10

Hey @pocesar, we made some significant changes to what modules we copy to the package and how we resolve modules run-time. I'd suggest updating your project to use platform android@next and the latest CLI.
Alternatively you can wait one more week for the official release where these fixes will be available in the stable builds.

@enchev
Copy link
Contributor Author

enchev commented Nov 25, 2016

From @pocesar on November 10, 2016 13:13

I'm now getting this error, can't start app anymore

screenshot_1478783562

@enchev
Copy link
Contributor Author

enchev commented Nov 25, 2016

From @NickIliev on November 10, 2016 14:25

@pocesar

Update your tns-core-modules and tns-core-modules-widgets as well

tns plugin remove tns-core-modules
tns plugin add tns-core-modules@next
tns plugin remove tns-core-modules-widgets
tns plugin add tns-core-modules-widgets@next

@enchev
Copy link
Contributor Author

enchev commented Nov 25, 2016

From @pocesar on November 10, 2016 15:40

already did that, even deleted node_modules, platforms and hooks folders

widgets
core

@Plamen5kov
Copy link
Contributor

Plamen5kov commented Dec 9, 2016

this is resolved with 2.4.0 release

@pkoleva pkoleva closed this as completed Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants