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

[question]update typescript to 4.2.x, An import path cannot end with '.ts' ? #44839

Closed
1gehunzi opened this issue Jul 1, 2021 · 2 comments
Closed
Labels
Duplicate An existing issue was already created Question An issue which isn't directly actionable in code

Comments

@1gehunzi
Copy link

1gehunzi commented Jul 1, 2021

when i upgrade typescript from 4.1.5 to 4.3.2, my progrom cannot build.

the error info: An import path cannot end with a '.ts' extension. Consider importing '@/api/common.js' instead.

version 4.1.5 is ok。Is it not allowed to use .ts extention after 4.2.x?

my tsconfig.json:

{
  "compilerOptions": {
    "target": "es2019",
    "module": "esnext",
    "moduleResolution": "node",
    "forceConsistentCasingInFileNames": true,
    "jsx": "preserve",
    "incremental": true,
    "isolatedModules": true,
    "strict": true,
    "resolveJsonModule": true,
    "importHelpers": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "skipLibCheck": true,
    "noUnusedLocals": false,
    "types": [
      "webpack-env",
      "jest"
    ],
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "includes": ["../shared/**/**"],
  "exclude": [
    "node_modules"
  ]
}
@1gehunzi 1gehunzi changed the title [ question]update typescript to 4.2.x, An import path cannot end with '.ts' ? [question]update typescript to 4.2.x, An import path cannot end with '.ts' ? Jul 1, 2021
@MartinJohns
Copy link
Contributor

See #38149, and note that this repository is not suited for questions. You should ask on StackOverflow instead.

@orta orta added Duplicate An existing issue was already created Question An issue which isn't directly actionable in code labels Jul 1, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants