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

Typescript 5.5 - Error: module is a string value; #299

Closed
markbrockhoff opened this issue Jun 24, 2024 · 3 comments
Closed

Typescript 5.5 - Error: module is a string value; #299

markbrockhoff opened this issue Jun 24, 2024 · 3 comments

Comments

@markbrockhoff
Copy link

markbrockhoff commented Jun 24, 2024

Hi, I encountered the following error after updating from Typescript 5.4.5 to 5.5.2.

Whenever I run the build command I get this strange error message:

> nuxt-module-build build

ℹ Building my-module                                                                               6:10:15 PM
ℹ Cleaning dist directory: ./dist                                                                  6:10:15 PM

[6:10:15 PM]  ERROR  module is a string value; tsconfig JSON must be parsed with parseJsonSourceFileConfigFileContent or getParsedCommandLineOfConfigFile before passing to createProgram

  at Object.createProgram (node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:123997:15)
  at getDeclarations (node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/mkdist/dist/index.mjs:302:22)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async mkdist (node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/mkdist/dist/index.mjs:525:35)
  at async mkdistBuild (node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/unbuild/dist/index.mjs:927:22)
  at async _build (node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/unbuild/dist/index.mjs:1086:3)
  at async build (node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/unbuild/dist/index.mjs:945:5)
  at async Object.run (node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected][email protected]_typescr_mlzbradpvbwn42jlyps562epy4/node_modules/@nuxt/module-builder/dist/chunks/build.mjs:43:5)
  at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:316:16)
  at async runCommand (node_modules/.pnpm/[email protected]/node_modules/citty/dist/index.mjs:307:11)

It looks like something might be wrong with the way the declarations are generated. I created a minimal reproduction using the nuxt module template as baseline: https://github.com/markbrockhoff/nuxt-module-template-bug-repro/tree/reproduce-ts-5.5-bug (Use branch reproduce-ts-5.5-bug)

To reproduce the issue you only need to install the dependencies and run pnpm prepack.

Any help narrowing this issue down would be appreciated, thanks.

@markbrockhoff
Copy link
Author

By the way: You can even see this issue within the action run of dependabot trying to upgrade typescript to 5.5 as well: https://github.com/nuxt/module-builder/actions/runs/9626387745/job/26552301785?pr=296

@danielroe
Copy link
Member

This is now resolved in mkdist and should be fixed with a lockfile refresh.

@markbrockhoff
Copy link
Author

Wow, that was fast. Issue is fixed thanks a lot @danielroe 👍🏻

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

2 participants