Skip to content

🐛 tsdown plugin crashes for backtick string literals in config #1776

Description

@TomerAberbach

Prerequisites

Reproduction url

https://github.com/TomerAberbach/knip-bug-repro

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

I got an error like this due to using backtick string literals in the tsdown config:

file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/WorkspaceWorker.js:385
            if (inputs.some(input => input.specifier.startsWith('!')))
                                                     ^

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/WorkspaceWorker.js:385:54
    at Array.some (<anonymous>)
    at runPlugin (file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/WorkspaceWorker.js:385:24)
    at async WorkspaceWorker.runPlugins (file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/WorkspaceWorker.js:395:33)
    at async build (file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/graph/build.js:132:35)
    at async run (file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/run.js:39:109)
    at async main (file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/cli.js:34:29)
    at async file:///Users/tomer/Library/pnpm/store/v11/links/@/knip/6.15.0/2bf3f3a1101223d6bf1aefe1376d4760a4d5f67995cd2a616a53d1c3ec0200d1/node_modules/knip/dist/cli.js:107:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions