Skip to content

Skipping a format results in warning about an unhandled promise rejection #76

@jakegavin

Description

@jakegavin

Current Behavior

Skipping one of the module formats causes a warning about an unhandled promise rejection due to an invalid rollup config.

> tsdx build --format cjs,es

(node:94549) UnhandledPromiseRejectionWarning: Error: You must supply an options object to rollup
    at getInputOptions$1 (/Users/jake/Desktop/mylib/node_modules/rollup/dist/rollup.js:18675:15)
    at Object.rollup (/Users/jake/Desktop/mylib/node_modules/rollup/dist/rollup.js:18732:30)
    at asyncro_1.default.map (/Users/jake/Desktop/mylib/node_modules/tsdx/dist/index.js:293:41)
    at Array.map (<anonymous>)
    at Object.n [as map] (/Users/jake/Desktop/mylib/node_modules/asyncro/dist/asyncro.js:1:100)
    at prog.command.describe.option.example.option.example.option.example.option.example.action (/Users/jake/Desktop/mylib/node_modules/tsdx/dist/index.js:292:43)
(node:94549) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:94549) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✓ Creating entry file 3.5 secs

As far as I can tell, the build still succeeds though so this isn't a huge issue.

Expected behavior

Ideally, the build would run without any warnings.

Suggested solution(s)

One possible solution would be to filter falsey values from the createBuildConfigs call: #77

Additional context

Thanks for the work you put into this!

Your environment

Software Version(s)
TSDX 0.5.5
TypeScript 3.4.5
Browser Chrome
npm/Yarn npm 6.4.1
Operating System MacOS 10.13.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions