Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #32642
Closed
Open
Issue created Dec 28, 2020 by Administrator@rootContributor

import bootstrap from 'bootstrap' - "export default was not found"

Created by: demiavaliani

I have Angular 11 & Bootstrap 5 project.

Following the documentation from here: Package managers > NPM

  1. "import bootstrap from 'bootstrap'" to expose the plugins.

  2. Now having "bootstrap" object, I go ahead and try to get instance of Modal for example: bootstrap.Modal.getInstance(myModal);

Received following error: "export 'default' (imported as 'bootstrap') was not found in 'bootstrap'

Looks like there is no default export in bootstrap library. Instead import * as bootstrap from 'bootstrap' fixed the issue.

Also, it would be good to have a mention of how to import properly the plugins inside the website Components section itself. For example, Components > Modal > getInstance just mentions that we can get instance of a Modal. But it does not say how to properly import the plugins first.

Assignee
Assign to
Time tracking