JMPerez / spotify-web-api-js

A client-side JS wrapper for the Spotify Web API
https://jmperezperez.com/spotify-web-api-js/
MIT License
1.86k stars 260 forks source link

Typescript example #184

Open vmiheer opened 4 years ago

vmiheer commented 4 years ago

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?

JMPerez commented 3 years ago

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.

davidseek commented 2 years ago

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 commented 2 years ago

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?