Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Vite audio not loading properly in static build

I have a vanilla js vite project. I'm struggling to import and play audio, it works properly in the dev environment but not in a static build.

The sound media file is stored as ./sounds/sound.mp3

At the very top of the html body I have the following element:

<audio type="audio/mpeg" src="/sounds/sound.mp3" autoplay></audio>

I have a button which pauses the audio directly below that. When you press it in build, console reads:

Uncaught (in promise) DOMException: The media resource indicated by the src attribute or assigned media provider object was not suitable.

You can see for yourself here, the sound button is at the bottom right of the page.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!