standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

Error on private npm class #862

Open mike-rivera opened 4 years ago

mike-rivera commented 4 years ago

I created the following gist to simulate my problem. https://gist.github.com/mike-rivera/5838b9c2d25d14e234648349ed0c1ee2

I created an npm package using ESM that comes from a local npm registry and I have the following:

package

client

When I run the script I get the following error on line 3 of my-client-script

TypeError: MyClass is not a constructor

if I install esm on the the client script to it works. This is a concern since not all of my clients applications will have esm installed.

jsg2021 commented 4 years ago

esm will need to be listed as a dependency in your library. not a devDependency.