unplugin-dts icon indicating copy to clipboard operation
unplugin-dts copied to clipboard

Unknown compiler option 'noUncheckedSideEffectImports' Please support typescript@latest!

Open ivanjeremic opened this issue 1 year ago • 6 comments

Describe the bug

Unknown compiler option 'noUncheckedSideEffectImports'

Please add support for typescript@latest! (5.6.3)

Reproduction

vitejs library project in lib mode + vite-plugin-dts

Steps to reproduce

npm create vite > advanced > library > typescript

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
    Memory: 4.24 GB / 7.74 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.17.0 - /run/user/1000/fnm_multishells/300197_1730707720987/bin/node
    npm: 10.9.0 - /run/user/1000/fnm_multishells/300197_1730707720987/bin/npm
    pnpm: 9.12.3 - /run/user/1000/fnm_multishells/300197_1730707720987/bin/pnpm
    bun: 1.1.28 - ~/.bun/bin/bun
  npmPackages:
    vite: ^5.4.10 => 5.4.10 
    vite-plugin-dts: ^4.3.0 => 4.3.0

Validations

ivanjeremic avatar Nov 04 '24 16:11 ivanjeremic

Also experiencing this issue:

Setup fresh vite app with Typescript + SWC, setup to run in Docker.

App works as expected with npm run dev, but npm run build fails with below output:

tsconfig.app.json:23:5 - error TS5023: Unknown compiler option 'noUncheckedSideEffectImports'.

23 "noUncheckedSideEffectImports": true ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tsconfig.app.json:3:5 - error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'.

3 "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", ~~~~~~~~~~~~~~~~~

tsconfig.node.json:21:5 - error TS5023: Unknown compiler option 'noUncheckedSideEffectImports'.

21 "noUncheckedSideEffectImports": true ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tsconfig.node.json:3:5 - error TS5069: Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or option 'composite'.

3 "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", ~~~~~~~~~~~~~~~~~

Found 4 errors.

System: OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa) CPU: (4) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz Memory: 8.61 GB / 15.62 GB Container: Yes Shell: 5.8 - /usr/bin/zsh Binaries: Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v18.20.2/bin/npm

Hallocoos avatar Nov 08 '24 09:11 Hallocoos

Fixed the issue by running: npm install --dev typescript@latest and npm install --global typescript@latest

Hallocoos avatar Nov 08 '24 09:11 Hallocoos

Fixed the issue by running: npm install --dev typescript@latest and npm install --global typescript@latest

I run your command , but it dont fix my bug

shuwanghu avatar Nov 16 '24 05:11 shuwanghu

I encountered the same issue when using rollupTypes: true option.

Pramuspl avatar Nov 22 '24 11:11 Pramuspl

please try this

plugins: [
    dts({
      include: ['src'],
      // rollupTypes: true, // current dts ts version 5.4.2. didn't support noUncheckedSideEffectImports yet
      tsconfigPath: './tsconfig.app.json', // or tsconfig.json
    }),
  ],

andihaki avatar Dec 11 '24 09:12 andihaki

I've had this issue when using rollupTypes: true but now it works after I upgraded TypeScript to 5.8.2 (5.7.2) and vite-plugin-dts to 4.5.3 (4.3.0). I haven't checked what the new versions contain - just a shot i dark - and so I don't know what has fixed the issue, but I'm sharing this to spread hope to others that also been stuck on this! 😄

mikaelkarlsson-se avatar Apr 04 '25 13:04 mikaelkarlsson-se

Currently the issue should be fixed if run with latest typescript and @microsoft/api-extractor.

If still any related problem, please open a new issue.

qmhc avatar Jul 30 '25 08:07 qmhc