bundlejs icon indicating copy to clipboard operation
bundlejs copied to clipboard

[Bug 🐞] Failed to fetch dependencies

Open harrytran998 opened this issue 3 years ago • 3 comments

Hi @bundlejs, thanks for your great tool. Today I checked my small UI library - wrap of Material UI --> But I have the error like the image below. I hope you can check that!

image

Link: https://bundlejs.com/?q=%40onemind%2Fui

harrytran998 avatar Jul 30 '22 08:07 harrytran998

@harrytran998 Unfortunately, this doesn't seem to be something I can fix. It seems due to the high number of packages and the even higher number of network requests, browsers are basically giving up. I'll try to optimize the fetch process but I'm not sure I can actually fix this problem.

A possible solution may be to pre-bundle Material UI, and then use it in your library, esbuild will automatically treeshake the unused parts of Material UI. Material UI as a set of 8K+ modules is too much for browsers to handle.

image

okikio avatar Jul 30 '22 21:07 okikio

After a bit of research I've determined I can't fix this, at least not while bundlejs is running in a browser. I'll look into other alternative solutions to fix this.

okikio avatar Jul 30 '22 21:07 okikio

Thanks for your quick response. I think your solution is valid for now(call HTTP in browser). So I will try to pre-bundle MUI. But if you find something interesting alternative solutions, pls let's me know 😆 🙏.

harrytran998 avatar Jul 31 '22 03:07 harrytran998

@harrytran998 It's now fixed, give it a try https://bundlejs.com/?q=@onemind/ui&bundle

okikio avatar Mar 29 '23 22:03 okikio

Please let me know if you run into this problem again

okikio avatar Mar 29 '23 22:03 okikio

Thanks for your work on this 😆 I checked it and everything ok! How do you handle this without call HTTP like before?

harrytran998 avatar Mar 30 '23 03:03 harrytran998

I made the package fetching algorithm more specific than before, allowing it to avoid fetching packages that could just be ignored or treeshaken away

okikio avatar Mar 30 '23 04:03 okikio

thanks for your hard work <3

harrytran998 avatar Mar 30 '23 10:03 harrytran998