Open cf19drofxots opened 5 years ago
Why was this closed @snario? This is still a problem. We're working around it with IIFEs.
@joelalejandro @cf19drofxots any thoughts on the fix?
Some overlapping work with counterfactual/monorepo#692
Stencil recommends installing some libraries for rollup
but unfortunately we hit this bug: https://github.com/ionic-team/stencil/issues/1305
I also think that this issue is relevant: https://github.com/ethers-io/ethers.js/issues/145
@joelalejandro @snario @cf19drofxots Lets move this to the new dapps-bots repo?
Sure thing. Transferring.
Done!
This is the error when
yarn build
is executed inpackages/dapp-high-roller
:'types' is not exported by ../cf.js/dist/index.js
occurs because the dist file forcf.js
does not have the right format. It's usingcjs
which is meant for NodeJS, not ES.When stencil build is doing its rollup, it's expecting an
export
to be present as is the format for theesm
build format.ethers
) seemingly not being distributed for the ES format either, a similar errors occurs.Since we don't have control over the imported libraries' distribution formats, we're required to use a rollup plugin which converts
cjs
(the format that the libraries do support) toesm
(for ES modules).However, configuring the stencil rollup configuration to use
rollup-plugin-commonjs
results in thestencil build
hanging. No further Stencil documentation or issues offer further help on resolving this at the moment.