When I try to use momentjs, installed through bower, my web app runs into the following error when the javascript file for moment is attempted to be loaded:
Uncaught SyntaxError: Unexpected token import
On this line:
import { hooks as moment, setHookCallback } from './lib/utils/hooks';
I am using ASP5, MVC6, Visual Studio 2015 Community. Couldn't find any answers to this here or on documentation from momentjs.
My script tag looks like:
<script type="text/javascript" src="~/lib/moment/src/moment.js"></script>
Looks like they include a built version of it already. I was using the src
version, which isn't compiled. Just point to the min
version and it'll be there, which is compiled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With