JavaScript import syntax error

the code is as follows

import * from xxxx

Why is this syntax not supported?

  1. Node.js does not support import, and Safari does not support import. Is this ES6 syntax not intended to be supported at all.
Jun.29,2022

  1. import * as utils from'. / Utils'
  2. nodejs supports import , but only supports .mjs suffix, and Safari also supports it, but it all depends on the version.

    import-sharp browser is compatible

Menu