Comments (3)
NestJS uses optional/peer dependencies for many modules, such as "@nestjs/microservices" and "class-validator" in your example.
To efficiently compile, bun needs to bundle all modules required by the code, even the ones you don't actually use. Have you tried installing all these libraries before compiling? It may fix the problem in the meantime. You could also set all these dependencies as "external" in your build step I guess.
However, it would be nice to allow compilation with these unknown modules.
Maybe with a flag like "--allow-missing-deps" or something?
And it would also be nice to document this behavior.
from bun.
NestJS uses optional/peer dependencies for many modules, such as "@nestjs/microservices" and "class-validator" in your example.
To efficiently compile, bun needs to bundle all modules required by the code, even the ones you don't actually use. Have you tried installing all these libraries before compiling? It may fix the problem in the meantime. You could also set all these dependencies as "external" in your build step I guess.
However, it would be nice to allow compilation with these unknown modules. Maybe with a flag like "--allow-missing-deps" or something? And it would also be nice to document this behavior.
thanks
from bun.
With v1.1.21 there's the new --packages=external
flag. I didn't test it, but since the problem is due to optional dependencies, I bet it would solve the issue if it can be coupled with --compile
.
Still, it would be nice to document that compilation with missing packages (add a warning about optional and peer dependencies, which are the most likely to trigger this) crashes. And that you have to either add the --packages=external
flag, manually set the not-needed packages as externals, or install all of them.
I'm still rooting for an --allow-missing-deps
flag of some sort, but that's probably just me.
from bun.
Related Issues (20)
- Bun.file:Memory observation mode【文件加载到内存并监视变化】
- crawlee playwright bun : Running crawlee's playwright crawler with bun causes Protocol mismatch error
- Fail to upgrade bun
- Next.js standalone with edge - Segmentation fault
- add glob matching to Bun.build
- Bun issue in dockerized NextJS
- AbortSignal,timeout and fetch bug when i cant reach server HOT 5
- Foldable JSON in VSCode debugger
- SQLIte named parameter ORDER BY not working
- Bun fails to update correctly through winget
- Bun crashed when handeling with LevelDD and RocksDB HOT 3
- Unexpected Segmentation fault HOT 3
- String.prototype.matchAll incorrectly fails for non-global RegExp HOT 1
- panic(main thread): Segmentation fault HOT 2
- llint_call_javascript CRASH HOT 4
- `bunx cowsay ""` - panic: reached unreachable code HOT 2
- 'ws' does not use custom client from options
- fetch api with http proxy using other authentication method than basic authentication
- panic(thread 2820): Internal Error: Do not pass posix paths to Windows APIs, was given '/'.
- Crash when using shell backticks with Bun shell HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bun.