New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import bootstrap from 'bootstrap' - "export default was not found" #32642
Comments
Note also that the official docs concerning how to find out the version number expect you to use the I was not aware of the |
@mdo is it worth having a default export boostrap object? Or should the documentation be updated directing users to export the specific components they require: e.g. |
I have Angular 11 & Bootstrap 5 project.
Following the documentation from here: Package managers > NPM
"import bootstrap from 'bootstrap'" to expose the plugins.
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.
The text was updated successfully, but these errors were encountered: