fregante / my-recurrent-errors

Problems I encounter often and never remember the solution to
0 stars 0 forks source link

SyntaxError: Cannot use 'import.meta' outside a module #3

Open fregante opened 4 years ago

fregante commented 4 years ago
❯ ava

  ✖ No tests found in tests/index.jsx

  ─

  Uncaught exception in tests/index.jsx

  ./tests/index.jsx:13
  const _require = (0, _module.createRequire)(import.meta.url);
                                                     ^^^^

  SyntaxError: Cannot use 'import.meta' outside a module

  ─

  1 uncaught exception
fregante commented 4 years ago

No AVA+Babel+ESM support: https://github.com/avajs/babel/issues/13

You need a bundler: https://github.com/vadimdemedes/dom-chef/pull/68