madzadev / audio-player

🎵 Music player with custom controls, playlist, filters, and search.
https://audioplayer.madza.dev
344 stars 49 forks source link

Module parse failed: Unexpected character '�' (1:0) #1

Closed tadinski closed 3 years ago

tadinski commented 3 years ago

Rendering Player component in a Nextjs project results in this error

Screenshot 2021-05-04 at 18 39 06

Tried figuring out what this is related to, most likely to the encoding format. Maybe you have a clue what might solve this issue?

madzadev commented 3 years ago

Hi @tadinski! Thank you for reporting! 😉

In order to run it in NextJS, follow these 3 steps:

  1. npm i next-images next-transpile-modules
  2. create next.config.js in your project's root
  3. paste this in that newly created config file:
    
    const withImages = require("next-images");
    const withTM = require("next-transpile-modules")(["@madzadev/audio-player"]);

module.exports = withImages(withTM());



Sry for being late on this, hope this helps 😉
madzadev commented 3 years ago

Also, updated docs and patched v.1.1.7, based on the issue 📄😉