-
Notifications
You must be signed in to change notification settings - Fork 5
Description
When using Node.js built-in modules (fs, path, crypto, etc.) in server-side files, Blade's bundler emits [UNRESOLVED_IMPORT] warnings during build:
[UNRESOLVED_IMPORT] Warning: Could not resolve 'crypto' in router.ts
╭─[ router.ts:7:20 ]
│
7 │ import crypto from "crypto";
│ ────┬───
│ ╰───── Module not found, treating it as an external dependency
───╯
The behavior is correct (treating them as external dependencies), but the warnings add noise to the dev console when working with server-side code that legitimately uses Node.js APIs.
Proposed Solution
Add a CLI flag or config option to suppress these warnings:
--quiet-externals or --suppress-node-warnings
Or a config option: { "build": { "suppressExternalWarnings": true } }
Alternatives Considered
Using dynamic imports (await import('fs')) - adds unnecessary async complexity
Ignoring the warnings - current workaround, but clutters the console
Additional Context
Warnings appear for both node:fs and fs style imports
App runs correctly; this is purely a DX improvement