nativescript-google-maps-sdk: TypeError: Class constructor View cannot be invoked without 'new'

TypeError: Class constructor View cannot be invoked without 'new'

NativeScript 7 with Vue.js when trying to create the map.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 26 (5 by maintainers)

Most upvoted comments

So my issue turned out be the handling of the plugin by babel

presets: [ [ '@babel/preset-env', { targets: { esmodules: true }, ----> include: ["transform-classes"] } ] ],

the inclusion of “include”:“[transform-classes”] solved it for me, I arrived to this answer through this https://stackoverflow.com/questions/36577683/babel-error-class-constructor-foo-cannot-be-invoked-without-new answer. I hope this helps someone.

… this happen when I click on the marker … I’ve did some debugs, it seems the infowindow does not exist at all on the plugin side.

Okay! Does it happen with the stable version of the plugin and nativescript 7+ or with the plugin version of #420? (nativescript 7 compatibility PR)

sorry, don’t replace map-view.d.ts by a js file but by the ts file I attach a zip file with the files I used maps.zip

@benco8186 try this:

  1. tns install babel
  2. put this in .babelrc
{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "esmodules": true
        },
        "include": [
          "transform-classes"
        ]
      }
    ]
  ]
}