Skip to content

import statement in .js file throws a syntax error #140

@kliehm

Description

@kliehm

I'm using the polyfill in context with Jest and Vue in a TypeScript environment, and I get this error, because there seems to be an import statement in a JavaScript file. Would it help to rename it .mjs?

node_modules\element-internals-polyfill\dist\index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { forceCustomStateSetPolyfill,
forceElementInternalsPolyfill, isElementInternalsSupported, } from "./element-internals.js";
                                                                                      ^^^^^^

SyntaxError: Cannot use import statement outside a module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions