Skip to content

failOnWarn doesn't work #759

@astanb

Description

@astanb

Reproduction link or steps

Been getting build failures on ci for UNRESOLVED_IMPORT which is great, unfortunatley it seems setting failOnWarn to true doesn't do anything, looks as though it just stays on its default value of 'ci-only'.

Here's my config:

module.exports = defineConfig({
	entry: ["./src/index.ts"],
	skipNodeModulesBundle: true,
	format: "esm",
	exports: true,
	clean: true,
	failOnWarn: true
});

Here's the output:

ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
ℹ config file: /tsdown.config.ts (unrun)
failOnWarn true
ℹ entry: src/index.ts
ℹ tsconfig: tsconfig.json
ℹ Build start
ℹ Cleaning 5 files
ℹ dist/index.mjs        11.98 kB │ gzip: 3.31 kB
ℹ dist/index.mjs.map    28.68 kB │ gzip: 7.98 kB
ℹ dist/index.d.mts.map   0.19 kB │ gzip: 0.15 kB
ℹ dist/index.d.mts       0.52 kB │ gzip: 0.26 kB
ℹ 4 files, total: 41.38 kB
src/index.ts (16:29) [UNRESOLVED_IMPORT] Warning: Could not resolve '@my-lib-name-here' in src/index.ts
    ╭─[ src/index.ts:16:30 ]
    │
 16 │ import { MY_CONSTANT } from "@my-lib-name-here";
    │                              ────────────────────┬────────────────────  
    │                                                  ╰────────────────────── Module not found, treating it as an external dependency
────╯

✔ Build complete in 1118ms

The build completes when it should be failing. I even hardcoded it and put a console.log into the options.[hash-here].mjs file, which outputs as true, but still doesn't work.

What is expected?

Errors on warning, build failure.

What is actually happening?

No error on warning, build success.

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions