You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
I am trying to use the plugin in its simplest form. Unfortunately, it seems that despite I can build an android app, as soon as I execute the code that contains one of these functions I get an error similar to this:
System.err: com.tns.NativeScriptException:
System.err: Calling js method onTouch failed
System.err: TypeError: DOM.getElementsByClassName is not a function
Neither of these importing methods work.
import * as DOM from "nativescript-dom"
//const DOM = require("nativescript-dom");
I use it like this const navBarItems = DOM.getElementsByTagName("nav-bar-item");
Hi @NathanaelA I'm having a similar issue. Since migrating to NativeScript 4 the plugin no longer works when bundling with Webpack. (tns run ios still works flawlessly.)
I'm using getElementsByTagName() and I'm importing at the top of my app.module.ts file like this:
import "nativescript-dom";
I think the way I import it is the right one. I don't get the mentioned is not a function errors. However getElementsByTagName() always returns an empty array when bundling with Webpack like this:
tns run ios --bundle --env.uglify --env.aot
Can you please take a look at it? I'm pretty sure something's broken here. If you cannot reproduce it in a Webpack build: Can you please share where and how you import?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I am trying to use the plugin in its simplest form. Unfortunately, it seems that despite I can build an android app, as soon as I execute the code that contains one of these functions I get an error similar to this:
Neither of these importing methods work.
I use it like this
const navBarItems = DOM.getElementsByTagName("nav-bar-item");
This is my packege.json
Any idea what can be causing this?
Thanks,
Fabio
The text was updated successfully, but these errors were encountered: