How to fix "Attempted import error"? / What audio player should I use for a Hybrid React-Native app?

80 Views Asked by At

I tried using react-native-track-player and it runs fine on android, but on the web, I get the following error:

./node_modules/react-native-track-player/lib/hooks.js
Attempted import error: 'STATE_BUFFERING' is not exported from './index' (imported as 'TrackPlayer').

I yet at this moment don't know how to fix this, but I will be grateful if someone knows how may I fix it or if there is a great alternative for an audio player that can be used for both web and android, and also be very lightweight.

Package versions:

"react": "^16.13.1",
"react-native": "0.63.4",
"react-native-track-player": "^1.2.3",
"typescript": "^4.1.3",

The tutorial I am following: https://medium.com/finimize-engineering/building-a-global-audio-player-in-react-native-dd065fc64b02

0

There are 0 best solutions below