Skip to content
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

TS2350: Only a void function can be called with the 'new' keyword. #121

Open
odmin4eg opened this issue May 13, 2021 · 0 comments
Open

TS2350: Only a void function can be called with the 'new' keyword. #121

odmin4eg opened this issue May 13, 2021 · 0 comments

Comments

@odmin4eg
Copy link

odmin4eg commented May 13, 2021

hi a'm use Vue

<template>
    <div id="viewer"></div>
</template>
<script lang="ts">
...
    import { Viewer } from 'photo-sphere-viewer';

and create new Viewer


  mounted() {
    this.initViewer();
  }

  public initViewer(): void {
    const config = {
      container: document.querySelector('#viewer'),
       panorama: this.images360,
        size: {
          width: '850',
          height: '550'
        }
    };
    this.panoramadata = new Viewer(config);
  };

Result:

ERROR Failed to compile with 1 error
ERROR in ./assets/js/components/organizationMap.vue.ts(64,25)
TS2350: Only a void function can be called with the 'new' keyword.

line 64 is: this.panoramadata = new Viewer(config);
_________________________^

What am I doing wrong?
why such a mistake?
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant