Skip to content

Add option to suppress Node.js built-in module resolution warnings #644

@mrkmadsn

Description

@mrkmadsn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions