Skip to content
This repository was archived by the owner on Jul 7, 2022. It is now read-only.
This repository was archived by the owner on Jul 7, 2022. It is now read-only.

Fails to load plugin in Angular NS 5.4+ "Events name(s) must be string." #28

@tomfaltesek

Description

@tomfaltesek

I have included the require("nativescript-platform-css") within the main.ts file. When I try to run the application an exception is thrown in the plugin (line 94).

// Setup Events
Page.on(Page.navigatingToFirst, setDevice); // Exception is thrown here (line 94).
Page.on(Page.showingModallyFirst, setDevice);

Exception:

JS ERROR TypeError: Events name(s) must be string.
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: TypeError: Events name(s) must be string.

When I debug, the value of Page.navigatingToFirst is undefined. I'm not quite sure what the root of this issue is.

I am able to get the plugin to work by manually updating the event setup code in platformcss.js from this:

// Setup Events
Page.on(Page.navigatingToFirst, setDevice);
Page.on(Page.showingModallyFirst, setDevice);

To this:

// Setup Events
Page.on(Page.navigatingToEvent, setDevice);

Is that other event no longer available in the latest NS?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions