-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.69.2
- OS Version: macOS 12.4
- TypeScript Version: 4.7.4
Steps to Reproduce:
- Create an
npm
package. Install[email protected]
andpretty-ms
. - Set
tsconfig.json
as:
{
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "esnext"],
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": ["./src/**/*"]
}
- Add
"type": "module"
inpackage.json
- Following error messages are displayed by VSCode in a file with
.ts
extension undersrc/
:
// Cannot find module 'pretty-ms' or its corresponding type declarations. ts(2307)
import ms from "pretty-ms";
// The 'import.meta' meta-property is not allowed in files which will build into CommonJS output. ts(1470)
console.log(import.meta.url);
tsc
throws no errors.- Change below values in
tsconfig.json
{
"module": "esnext",
"moduleResolution": "node"
}
- VSCode no longer throws any errors.
adamazad, maxholman, shuhrat, elementum, mikkopiu and 14 morebrainkim, ethanresnick, jonathantneal, kachkaev, maxholman and 3 more
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone