fibo / trunx

Super Saiyan React components, son of awesome Bulma
MIT License
64 stars 14 forks source link

fix: export was not found - module has no exports #37

Closed lowsky closed 1 year ago

lowsky commented 2 years ago

Simply removing "type": "module" from package.json because the output is not compiled into ESM compatible module.

This fixed the errors for me, I ran into when upgrading to latest CRA with react-scripts 5.x: e.g.

export 'Navbar' (imported as 'Navbar') was not found in 'trunx' (module has no exports)

fixes trunx issue https://github.com/fibo/trunx/issues/36

Thanks, @fibo for creating this library! It would be nice, when you could release a new version, soon.

fibo commented 2 years ago

thanks for your contribution,

I tried removing "type": "module" in a NextJS app and I get error:

ReferenceError: exports is not defined

I did also other attempts but could not get a build working with new module resolution, it looks like it needs more time.

I was able to get a package working with both CommonJS and ES module here using new "exports" attribute.

fibo commented 1 year ago

@lowsky thanks for the contribution, "type":"module" was added in another branch, now published as version 0.42.2

lowsky commented 1 year ago

Latest version, v0.42.2 works like a charm. Thx, @fibo, for updating !