Skip to content

Default import typescript error #488

@Souvlaki42

Description

@Souvlaki42

I apollogize in advance, if my question is silly but why I get:

module "node_modules/.pnpm/[email protected]/node_modules/fast-glob/out/index" can only be default-imported using the 'esModuleInterop' flagts(1259)
index.d.ts(40, 1): This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

When using this in modern typescript + vite?
Here is my tsconfig.json:

{
	"compilerOptions": {
		"target": "ES2018",
		"module": "NodeNext",
		"moduleResolution": "nodenext",
		"esModuleInterop": true,
		"allowSyntheticDefaultImports": true,
		"forceConsistentCasingInFileNames": true,
		"sourceMap": true,
		"inlineSources": true,
		"jsx": "react",
		"jsxFactory": "h",
		"jsxFragmentFactory": "Fragment",
		"lib": ["ES2018", "DOM"],
		"isolatedModules": true,
		"moduleDetection": "force",
		"noEmit": true,
		"noUnusedLocals": true,
		"noUnusedParameters": true,
		"noFallthroughCasesInSwitch": true,
		"noUncheckedSideEffectImports": true,
		"useDefineForClassFields": true,
		"skipLibCheck": true
	},
	"include": ["src"],
	"exclude": ["node_modules"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions