Import in jquery not working

I switched from autoNumeric.js 1.9.41 to AutoNumeric.js 4.0.3 and this library uses an import feature which is causing me an issue it is “import AutoNumeric from ‘./AutoNumeric’;” saying “Uncaught SyntaxError: Unexpected identifier”

Any idea ?

Are you trying to run this in a browser directly? If so, support for ES6 modules hasn’t really landed in browsers yet (although it’s on its way).

You’ll need to use a bundler (like Webpack) to transform this into something browsers can understand.

This might also help:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.