Friday, March 2, 2018

Re: Django sending syntax errors on ES syntax of imported JS file

Jani Tiainen, Your assertion that ES is not very well supported is incorrect.  Most of ES6 is in fact highly supported across browsers except for certain specifications that are still being worked on regarding implementation details.  For reference, look at http://kangax.github.io/compat-table/es6/. It all depends on your target audience, but using babel to transpile by default is a good practice.

As to the original issue, the problem is OP is using a non-compatible browser for imports, as you can see at https://caniuse.com/#feat=es6-module  Firefox and IE are the big names that have  no native support and will require a transpiled version to work.

TL;dr front end can be a mess, OP got caught in it and there are ways around it.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fbc86dde-6230-4bab-a2d3-65c669584dbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment