brisa-build / brisa

The Web Platform Framework.
https://brisa.build
MIT License
452 stars 12 forks source link

From Brisa 0.0.177 build breaks when importing monorepo deps #434

Closed AlbertSabate closed 2 months ago

AlbertSabate commented 3 months ago

Can't find module from monorepo package. I believe has something to be with the initial @. Because the package is correctly installed into node_modules and version 0.0.176 is building fine.

AlbertSabate commented 3 months ago

After some digging I found out which the problem is when a package.json has "exports": {...}, and nothing to be with monorepo or not.

Opened a PR with a temporal solution. I said temporal, because I was fixing without know what was going on, so code is ugly. But now that we know what's happening, we could optimise the code :)

There is a confirmed issue. Also not sure if this happens only with BunJS or as well in NodeJS. Maybe is just a Bun bug, and we can temporary use this until bun fixes the issue and no need to overcomplicate ourself more with it. Because the new code is in a catch, this will only trigger in case that the file does not exists. So, will only affect broken or this case. Should not affect to other scenarios.