allowImportingTsExtensions warning #1536
Replies: 29 comments 1 reply
-
| I'm also seeing this when  | 
Beta Was this translation helpful? Give feedback.
-
| i also met this problem too.Is there any solution? {
  "compilerOptions": {
    "target": "ES2021",
    "useDefineForClassFields": true,
    "lib": [
      "ES2021",
      "DOM",
      "DOM.Iterable"
    ],
    "types": [
      "vite/client",
      "node"
    ],
    "module": "ESNext",
    "skipLibCheck": true,
    "declaration": true,
    /* Bundler mode */
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    /* Linting */
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noFallthroughCasesInSwitch": true,
    "jsx": "react-jsx",
    "baseUrl": ".",
    "paths": {
      "@common/*": [
        "components/_common/*"
      ],
      "@/*": [
        "components/*"
      ],
    }
  },
  "include": [
    "components"
  ],
  "references": [
    {
      "path": "./tsconfig.node.json"
    }
  ]
}{
  "peerDependencies": {
    "antd": ">=5.6.3",
    "ramda": ">=0.29.0",
    "react": ">=18.2.0",
    "react-dom": ">=18.2.0",
    "classnames": ">=2.3.2",
    "@ant-design/icons": ">=5.0.1",
    "react-intl": ">=6.4.4",
    "uuid": ">=9.0.0",
    "ahooks": ">=3.7.6",
    "react-draggable": ">=4.4.5",
    "@dnd-kit/core": ">=6.0.8",
    "@dnd-kit/modifiers": ">=6.0.1",
    "@dnd-kit/sortable": ">=7.0.2",
    "@dnd-kit/utilities": ">=3.2.1",
    "@iconify/react": ">=4.1.1",
    "moment": ">=2.29.4",
    "react-evefyou-hooks": ">=1.0.7"
  },
  "devDependencies": {
    "@types/uuid": "^9.0.1",
    "@rollup/plugin-typescript": "^11.1.2",
    "@types/node": "^20.4.9",
    "@types/ramda": "^0.29.0",
    "@types/react": "^18.2.15",
    "@types/react-dom": "^18.2.7",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "@vitejs/plugin-react": "^4.0.3",
    "eslint": "^8.45.0",
    "less": "^4.1.3",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.3",
    "tslib": "^2.6.1",
    "typescript": "^5.1.6",
    "vite": "^4.4.5",
    "vite-plugin-dts": "^3.5.1",
    "vite-tsconfig-paths": "^4.2.0"
  }
}
 | 
Beta Was this translation helpful? Give feedback.
-
| +1 on this issue. | 
Beta Was this translation helpful? Give feedback.
-
| +1 on this issue. | 
Beta Was this translation helpful? Give feedback.
-
| Setting the  | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| Has it been resolved? | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 I think just a discussion won't be given much importance, it should be turned into a question to be taken seriously. | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 Using both noEmit and allowImportingTsExtensions (even when only one of them exists) in ts config file gives me an error:  | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| +1 | 
Beta Was this translation helpful? Give feedback.
-
| This issue was first reported back in July 2023 and not resolved. Is this project still alive? | 
Beta Was this translation helpful? Give feedback.
-
| This is fixed by setting  It's buried within the docs: https://github.com/rollup/plugins/tree/master/packages/typescript/#noforceemit | 
Beta Was this translation helpful? Give feedback.
-
| No, it isn't resolved. Please see the previous comments about setting  | 
Beta Was this translation helpful? Give feedback.
-
| 2025, still having this problem | 
Beta Was this translation helpful? Give feedback.
-
| I tried the noForceEmit. Nothing changed, though. | 
Beta Was this translation helpful? Give feedback.
-
| This might help people using the plugin with Vite: | 
Beta Was this translation helpful? Give feedback.
-
| I removed this warning on two different dual package libraries by also adding the following; "rewriteRelativeImportExtensions": trueTo summarize the TS handbook ; The  So my final tsconfig.json was the following; "compilerOptions": {
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "rewriteRelativeImportExtensions": true
}My usecase may be different, but it neatly solved my issues. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
tsconfig.json has "noEmit" set: true,
But warning:
(!) Plugin typescript: @rollup/plugin-typescript TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
Beta Was this translation helpful? Give feedback.
All reactions