ASSERTION ERROR The provided value must be an instance of a DOM Node but got AppHostView(1)

Viewed 814

a hava a an app than worked fine several weeks aggo, but I have just retruned to work with it an when I debug it, it keep sending me the error:

ASSERTION ERROR The provided value must be an instance of a DOM Node but got AppHostView(1)

Please I need some advise.

Thanks

3 Answers

It seems like your components (nativescript, angular, webpack, ...) versions ran out of sync. A reset of the webpack config and the project might help to restore a working version.

try this:

  1. ./node_modules/.bin/update-ns-webpack --configs
  2. rm -rf node_modules
  3. rm -rf platforms
  4. rm -rf hooks
  5. rm package-lock.json
  6. npm i
  7. tns build android or ios

If you are on Nativescript 7 there is the ns clean command that does this for you.

for me it was app.component.html which was causing the error. It Was

<StackLayout>
    <page-router-outlet></page-router-outlet>
</StackLayout>

changed to

<Label text="demo text"></Label>

error gone. trying to figure out how to use page-router-outlet now

What worked for me, and I cannot explain the mechanics behind the workaround, was deleting the "hooks", "node-modules" and "platforms" folders as well as the "package-lock.json" and "webpack.config.js" files and issuing a new "npm install" command.

Related