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

self is not defined #23

Open
OsirisFrik opened this issue Jun 30, 2019 · 2 comments
Open

self is not defined #23

OsirisFrik opened this issue Jun 30, 2019 · 2 comments

Comments

@OsirisFrik
Copy link

On import lib throw error with message self is not defined

image

@area73
Copy link

area73 commented Sep 18, 2020

same here, working with node:

const { Client } = require('spotify-sdk');

Throws:

ReferenceError: self is not defined
    at Object.<anonymous> (/Users/.../node_modules/spotify-sdk/lib/dist.js:22:12223)

And If I try running with ES6 modules I got:

import { Client, UserHandler, TrackHandler, PlaylistHandler, ArtistHandler } from 'spotify-sdk';
         ^^^^^^
SyntaxError: The requested module 'spotify-sdk' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from 'spotify-sdk';
const { Client, UserHandler, TrackHandler, PlaylistHandler, ArtistHandler } = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:21)

@ogallagher
Copy link

Same for me, too.

key value
npm version 9.6.4
node version 19.2.0

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

3 participants