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

311
Views
Problem with import from Bootstrap in javascript

I am trying to use bootstrap not only in html but also in my JavaScript/TypeScript. I imported bootstrap min js and min css in my html. In my TypeScript used this: import * as bootstrap from "bootstrap";

When I try to use this code:

 var myModal = new bootstrap.Modal(document.getElementById('popup'), {
      keyboard: false
 })
 myModal.hide()

the chrome console said:

Uncaught TypeError: Failed to resolve module specifier "bootstrap". Relative references must start with either "/", "./", or "../".

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I believe you don't need any imports in this case, you can use it without import.

var myModal = new bootstrap.Modal(document.getElementById('popup'), {
      keyboard: false
 });
 
 console.log(myModal);
<div id="popup">popup</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>

about 4 years ago · Juan Pablo Isaza Report
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!