TamasBarta / obsidian-spotify-embed

Obisidian plugin to allow you to embed Spotify playlists or songs in your Obsidian markdown documents.
30 stars 2 forks source link

Failed to load #1

Closed doguaraci closed 1 year ago

doguaraci commented 2 years ago

Hi I get the following error message when I try to activate the spotify-embed.

Plugin failure: obsidian-spotify-embed SyntaxError: Cannot use import statement outside a module
    at eval (<anonymous>)
    at app.js:1
    at t.<anonymous> (app.js:1)
    at app.js:1
    at Object.next (app.js:1)
    at s (app.js:1)
TamasBarta commented 2 years ago

Hi,

I couldn't reproduce your issue. Can you tell me more about your environment, how you installed the plugin, etc?

I left out some original installation steps described in the template repo, because I thought I'll revisit that sooner, and publish the plugin. The way you should install it is to clone the repo, build the plugin, and only then you'll have the main.js which you'll be able to copy over. The build steps are omitted from the README, but it should look like this (as described in the template repo):

git clone https://github.com/TamasBarta/obsidian-spotify-embed.git
cd obsidian-spotify-embed
npm i
npm run build
mkdir -p <obisidianvault>/.obsidian/plugins/obsidian-spotify-embed
cp main.js manifest.json <obisidianvault>/.obsidian/plugins/obisidian-spotify-embed/

I hope this helps, but it's just my assumption that it's because you copied the main.ts over instead of the compiled plugin.

TamasBarta commented 1 year ago

Closing for no further clue to continue on. Feel free to provide more details, or open a new issue.