Skip to content

Importing from package causes error in build only. #164

@Flohhhhh

Description

@Flohhhhh

When running in development, I have no error and it works perfectly.
Running build throws minified error below.
(Even without import for audio file error still occurs)

Error:

Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Decoded error:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

My code:

import ReactAudioPlayer from 'react-audio-player'
import Music from './assets/audio/music.mp3'

function App() {
  return (
      <div className="app">
         <ReactAudioPlayer id="audio-controls" src={Music} autoPlay loop controls volume={0.05}/>
      </div
   }
}

Also found this error on the tsconfig.json
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions