developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8k stars 361 forks source link

Add minimum logging when failing #1021

Closed pimsdsigd closed 1 year ago

pimsdsigd commented 1 year ago

Hello, today I wanted to build my react library that I built yesterday successfully. It did not work and I cant find why because there is no debug output (following the README). The process even returns 0 while doing nothing. Nothing changed on my configuration from yesterday to today, and the build does not even work anymore in CI with static build images.

Here the output provided by the microbundle call :

"C:\Program Files\nodejs\npm.cmd" run build

> @aaa/react-inputs@1.0.27 build
> microbundle-crl --no-compress --format modern,cjs

Build "reactInputs" to dist:

Process finished with exit code 0

Yesterday it was showing which files were built, and the dist/ folder would be filled with output files. It may (surely) be an error in my library but how am I supposed to know what is failing if the compilator does not show anything ? Editor does not highlight any potential failure.

Is there a way to configure microbundle to print more logs ?

Thank you

rschristian commented 1 year ago

microbundle-crl is a (unmaintained) fork of this project. You can find its repo here. Yes, the author never updated the meta data so NPM, etc still point here, unfortunately.

Can you reproduce this issue with Microbundle proper?

pimsdsigd commented 1 year ago

Ok sorry I did not know about the fork.

> microbundle --no-compress --format modern,cjs

Error: No entry module found for "@aaa/react-inputs"

Looks like I will have to do some digging and configuration, I will come back to you when fixed.

pimsdsigd commented 1 year ago

I found the issue looking in my index.js file which changed from yesterday. Output was not produced because index.js was not valid anymore to be picked as source file. Thank you for your (very) (quick) help ! 🙏

rschristian commented 1 year ago

No worries!

It's certainly possible the logging is still lacking with microbundle so if you are able to reproduce let us know and we can take a peek at improving. We definitely don't want users struggling

pimsdsigd commented 1 year ago

The issue was no source were detected with microbundle-crl, which gave no error (and a return code 0). microbundle stated rightfully that no source were available with return code 1 (that is what I assumed from 'No entry module found'). Maybe microbundle could print a message stating the specific message for missing source (and not entry) ? Please note that the message should definitly be more precise in -crl, not the base microbundle, which does return a message.