Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the default export nested / double-wrapped? #14

Open
jmealo opened this issue Mar 29, 2021 · 1 comment
Open

Is the default export nested / double-wrapped? #14

jmealo opened this issue Mar 29, 2021 · 1 comment

Comments

@jmealo
Copy link

jmealo commented Mar 29, 2021

Thanks for the great module! I use it all the time in my commonJS projects and I'm hitting trouble with ESM/Typescript:

not working

import DAGMap from 'dag-map'
const map = new DAGMap()
const map = new DAGMap();
            ^
TypeError: DAGMap is not a constructor

working

import _DAGMap from 'dag-map'

// @ts-ignore
const DAGMap = _DAGMap.default

const map = new DAGMap()

I noticed that the default class exported is actually named DAG but I don't think that's related.

@jmealo
Copy link
Author

jmealo commented Mar 30, 2021

It seems like the UMD module is double wrapped. I'm out of my element with ESM/Typescript build processes as this is my first attempt from scratch. I'll try to circle back and see if upgrading the devDependencies/config makes the output not nested.

@jmealo jmealo changed the title Typescript usage? Is the default export nested / double-wrapped? Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant