spotify-web-api-js icon indicating copy to clipboard operation
spotify-web-api-js copied to clipboard

Typescript example

Open vmiheer opened this issue 5 years ago • 3 comments

Hi, am following readme instructions and I am getting error:

Uncaught TypeError: spotify_web_api_js_1.default is not a constructor
import SpotifyWebApi from 'spotify-web-api-js';
let spotify = new SpotifyWebApi();

Am I missing something obvious?

vmiheer avatar Sep 15 '20 02:09 vmiheer

Hi @vmiheer. Could you share an example of your project, maybe using codesandbox?

I just tried the code on https://codesandbox.io/s/amazing-cherry-31eom?file=/src/index.js and it seems to be working.

JMPerez avatar Dec 11 '20 20:12 JMPerez

I'm having the same problem in a Firebase Functions project. Literally same logic as in the shared codesandbox, and yet I as well get:

Uncaught TypeError: spotify_web_api_js_1.default is not a constructor

davidseek avatar Nov 16 '21 20:11 davidseek

NVM

I'm sure the other dude was using this lib for Node as well. Might be a good idea to put a disclaimer up and linking to the Node version?

davidseek avatar Nov 16 '21 20:11 davidseek