1

I tried installing bootstrap 4 version beta.2 and its dependencies (jquery and popper.js). but there is something very weird going on. for some reason, I keep getting an error message in the console, saying "SyntaxError: export declarations may only appear at top level of a module". when I click to go to the line that's causing this issue in the scripts.bundle.js, I find that it's the popper.js package that's causing this issue.

I have included the script references to my angular-cli.json file as follows:

 "scripts": [
    "../node_modules/jquery/dist/jquery.slim.min.js",
    "../node_modules/popper.js/dist/esm/popper.min.js",   
    "../node_modules/bootstrap/dist/js/bootstrap.min.js",
    "../node_modules/alertifyjs/build/alertify.min.js"
  ]

I think I did everything right, but I don't know why the issue with popper is occuring.

Please help me find an answer to this.

Kenchi
  • 191
  • 1
  • 3
  • 18
  • 1
    Yeah this is a known issue. Currently the fix is to use the umd/popper.min.js option. You'll find hundreds of results if you look for bs4 + popperjs – Iskandar Reza Dec 26 '17 at 21:50
  • Thanks!!. that solved it for me. But, now there's a new message in the console, saying "Source map error: request failed with status 404 Resource URL: http://localhost:4200/scripts.bundle.js Source Map URL: bootstrap.min.js.map". is that going to be an issue? – Kenchi Dec 27 '17 at 11:16
  • I think that is a systemjs configuration error, which is a bit more complicated to narrow down exactly but the 404 hints at it being a path problem. – Iskandar Reza Dec 27 '17 at 17:15

1 Answers1

0

If you are running Angular CLI. Then use

npm install ngx-bootstrap --save

FYR: Bootstrap 4 in Angular CLI

pradeep kumar
  • 983
  • 10
  • 21