virtuoso-dev / urx

urx is a stream-based Reactive state management library
https://urx.virtuoso.dev/
MIT License
37 stars 5 forks source link

0.2.9 - failed to resolve dist/index.cjs.js #49

Closed jschill closed 2 years ago

jschill commented 2 years ago

My build is broken since a couple of days back with the following message from my bundler (FuseBox):

WARNING Statement "dist/index.cjs.js" has failed to resolve in module "@virtuoso.dev/react-urx"
WARNING Statement "dist/index.cjs.js" has failed to resolve in module "@virtuoso.dev/urx"

I guess it's because of the package.json changes introduced in 0.2.9. Looking in the dist folder there's no such file. However there is one named index.cjs. Is this expected?

petyosi commented 2 years ago

I don't know anything about FuseBox, I'm afraid. .cjs should be a valid extension for commonjs module? microbundle does it by default, and I had to move away from the previous bundling framework.

https://github.com/developit/microbundle

jschill commented 2 years ago

Yea it seems like fusbox can't handle that.

I'm surprised this was the first time the problem appeared - we have quite a few dependencies and those have its own dependencies etc. When looking in my node_modules there are no other .cjs-files while there are a few .cjs.js

jschill commented 2 years ago

If anyone else comes here in the same situation, I solved it by creating a postinstall script that copies the .cjs file to .cjs.js.

https://gist.github.com/jschill/6d79abaa12be3a5ca29368718bb7768f

petyosi commented 2 years ago

Thank you. Out of curiosity - are you using urx as a standalone, or as part of the virtuoso library?

jschill commented 2 years ago

Thank you. Out of curiosity - are you using urx as a standalone, or as part of the virtuoso library?

Sorry for the late reply. As part of Virtuoso.

We've been jumping between state managment libs and are right now using two :-( of them. I guess redux observable was the closest one to urx.

petyosi commented 2 years ago

@jschill I reverted the build system back to tsdx. There's something wrong with the change: https://github.com/petyosi/react-virtuoso/issues/517#issuecomment-987633537