Unexpected token import in all.js


#1

I’m having some issues getting the frontend setup working from the “Frontend Fun” chapter - none of the JS functionality in bootstrap is working, and when I look in devtools in the browser, I get the following error: Uncaught SyntaxError: Unexpected token import
This error points to line 1 of all.js (the file we created with Gulp and the bootstrap source .js files). Line 1 of all.js points to "import Util from ‘./util’

Is there something I’m missing? I’ve linked to the all.js file in my base.html template using:


#2

Did you mean to post something additionally here?

So, first as a caveat, I’m not very up to date about JavaScript stuff. Seems like the import statement is ES6, and when it says “unexpected token import”, statements like that usually means something isn’t installed.

Kind of wondering if Bootstrap updated since I used it, or I have a bug and we should have installed something else too, hmm.

After some googling, seeing a lot of references to the Babel compiler, maybe installing this will help? https://babeljs.io/