adobe / lit-mobx

Mixin and base class for using mobx with lit-element
Apache License 2.0
269 stars 16 forks source link

ESM Module type is missing in package.json #166

Closed MuhammedKalkan closed 1 year ago

MuhammedKalkan commented 1 year ago

While trying to test our components with mocha. We are experiencing issues with the library. Giving this error:

import { MobxLitElement } from "@adobe/lit-mobx";
         ^^^^^^^^^^^^^^
SyntaxError: Named export 'MobxLitElement' not found. The requested module '@adobe/lit-mobx' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@adobe/lit-mobx';
const { MobxLitElement } = pkg;

Now if we add "type": "module" to packge.json file of the @adobe/lit-mobx error goes away.

Is it possible that this is missing from the lib ? Or to add and *.mjs export ?