Skip to content

The Value is non of these types error thrown for invalid return value in function options is difficult to figure the reason #9005

@sapphi-red

Description

@sapphi-red
import { defineConfig } from 'rolldown'

export default defineConfig({
  input: "./index.js",
  // should return boolean, but returns a number
  external: id => ['foo'].find(name => id === name)
})

errors with

<anonymous_script>:0


[Error: Value is non of these types `bool`, `UnknownReturnValue`, ] {
  code: 'InvalidArg'
}

.
REPL

This error message is difficult to understand. It would be better to show the stacktrace if possible. If that's difficult, we should show the option name.

Metadata

Metadata

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

Status

In progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions