question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latest type definition breaks typescript compilation

See original GitHub issue

My typescript code uses the api as follows :

import * as SpotifyWebApi from 'spotify-web-api-js';

let spotifyApi: SpotifyWebApi.SpotifyWebApiJs;

This works fine with 1.1.0 . Since 1.1.1 , this fails with Namespace '".../spotify-web-api"' has no exported member 'SpotifyWebApiJs' .

I could not find a way to work with the new type file.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
amelialaundycommented, Dec 21, 2018

Hey @pduchesne I have the following:

import SpotifyWebApi from 'spotify-web-api-js'
export class Spotify {
	private client: SpotifyWebApi.SpotifyWebApiJs;
	constructor(token: string) {
		this.client = new SpotifyWebApi();
		this.client.setAccessToken(token);
	}

That should work for you.

I think I made those type changes in 1.1.0, and sounds like what you are saying is they are breaking changes so I’ll take a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSConfig Reference - Docs on every TSConfig option
Future versions of TypeScript may introduce additional stricter checking under this flag, so upgrades of TypeScript might result in new type errors in...
Read more >
Typescript Typings: The Complete Guide: @types Compiler ...
This is also because the Typescript compiler features keep evolving so fast that not all type definitions leverage all the latest features.
Read more >
TypeScript Compiling with Visual Studio Code
Typically the first step in any new TypeScript project is to add a tsconfig.json file. A tsconfig.json file defines the TypeScript project settings,...
Read more >
Understanding TypeScript's “Compilation Process” & the ...
Similarly, when you define a variable without a type, the TypeScript compiler infers the type from the value being assigned to the variable....
Read more >
rollup/plugin-typescript
Latest version: 10.0.1, last published: a month ago. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found