Cant import anything in main.js


Im creating a project with Sage 9, but am running into a problem:

I cant import anything in main.js. Im getting this error on import ‘jquery’;
Uncaught SyntaxError: Unexpected string

Replacing this by import jQuery from ‘jquery’ results in:
Uncaught SyntaxError: Unexpected identifier

I want to use the jspdf extension, but am not able to in this way. Does anybody know what might cause this? Im getting the same error with a clean Sage install

Sage already imports jQuery:

And this builds fine on a clean install — are you sure nothing has been changed, and that you have ran yarn and yarn build successfully?

What version of Node are you running? Sage 9 is not compat with Node 12 out of the box, but works fine with Node 8, 9, and 10

This topic was automatically closed after 42 days. New replies are no longer allowed.