Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TypeScript >= 5.5 - "Error: target is a string value" #94

Open
rpearce opened this issue Jul 13, 2024 · 0 comments
Open

[Bug]: TypeScript >= 5.5 - "Error: target is a string value" #94

rpearce opened this issue Jul 13, 2024 · 0 comments

Comments

@rpearce
Copy link

rpearce commented Jul 13, 2024

Hi!

When trying to upgrade an OSS package of mine from [email protected] to @5.5.3, I ran into an error seeming to come from this package.

Expand to see error
Error: target is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram
    at Object.createProgram (/<REDACTED>/node_modules/typescript/lib/typescript.js:123997:15)
    at <anonymous> (/<REDACTED>/node_modules/@storybook/react-docgen-typescript-plugin/src/plugin.ts:248:32)

The error appears to be coming from

const tsProgram = ts.createProgram(
modulesToProcess.map(([name]) => name),
compilerOptions
);

It looks like this is the same issue as in nuxt/module-builder#299 that was fixed in https://github.com/unjs/mkdist/pull/224/files by using ts.convertCompilerOptionsFromJson(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant