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

Suggestion: ES Module import #92

Closed
nikosszzz opened this issue May 2, 2022 · 4 comments
Closed

Suggestion: ES Module import #92

nikosszzz opened this issue May 2, 2022 · 4 comments

Comments

@nikosszzz
Copy link

Hello,

Is there a way to get any of these functions of this package using import as a module? I keep getting errors that it dont has named exports. I have a discord bot depending on this, so any help would be helpful.

@Kikobeats
Copy link
Member

Hello, can you test v3.1.1? it should be fixed the error.

@nikosszzz
Copy link
Author

import { spotifyUrlInfo } from "spotify-url-info";
         ^^^^^^^^^^^^^^
SyntaxError: Named export 'spotifyUrlInfo' not found. The requested module 'spotify-url-info' is a CommonJS module, which may not support all module.exports as named exports.        
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'spotify-url-info';
const { spotifyUrlInfo } = pkg;

Unfortunately, not fixed.

@Kikobeats
Copy link
Member

did you try the suggestion?

import pkg from 'spotify-url-info';
const { spotifyUrlInfo } = pkg;

@nikosszzz
Copy link
Author

Still not working, says it is not a function.

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

2 participants