Replies: 8 comments 3 replies
-
Can you share a minimal demo? (for example with codesandbox). |
Beta Was this translation helpful? Give feedback.
-
same error with beta3. Use beta1 or beta2 |
Beta Was this translation helpful? Give feedback.
-
What are you importing ( |
Beta Was this translation helpful? Give feedback.
-
There is no export default in .esm file. This is what it exports: export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Offcanvas, Popover, ScrollSpy, Tab, Toast, Tooltip }; To import bootstrap use following example: <script>
import HelloWorld from './components/HelloWorld.vue'
// import { Alert } from 'bootstrap/dist/js/bootstrap.esm'
import * as name from 'bootstrap/dist/js/bootstrap.esm'
export default {
name: 'App',
components: {
HelloWorld
},
mounted(){
// console.log(Alert);
console.log(name.Alert)
}
}
</script> |
Beta Was this translation helpful? Give feedback.
-
@korki43
|
Beta Was this translation helpful? Give feedback.
-
@ntd0609 see the example above by @xdvarpunen. Bootstrap doesn't provide a default export. You can import specific components using |
Beta Was this translation helpful? Give feedback.
-
@korki43 |
Beta Was this translation helpful? Give feedback.
-
I got the same error using ES6 and webpack. My loader in My solution
added an extra webpack loader that handled the bootstrap javascript without excluding the node_modules.
|
Beta Was this translation helpful? Give feedback.
-
ERROR in node_modules/bootstrap/dist/js/bootstrap.esm.js
Module parse failed: Unexpected token (1148:15)
You may need an appropriate loader to handle this file type.
|
| _getConfig(config) {
| config = { ...Default$8,
| ...config
| };
@/node_modules/babel-loader/lib??ref--2-0!/node_modules/vue-loader/lib??vue-loader-options!./List.vue?vue&type=script&lang=js& 35:0-34
at line 35 I import bootstrap 5
import bootstrap from "bootstrap";
Please help me
Beta Was this translation helpful? Give feedback.
All reactions