π Search Terms
allowSyntheticDefaultImports
lodash-es
π Version & Regression Information
Version 4. x does not support 'moduleSolution': 'Bundler', so I only tried 5.6.2
β― Playground Link
https://github.com/bosens-China/picture-bed
π» Code
import _ from 'lodash-es';
// Usage of lodash function
console.log(_.debounce(() => console.log('Hello, world!'), 1000));
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"resolveJsonModule": true,
/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
},
"include": ["src"]
}
π Actual behavior
src/store/features/users/slice.ts:3:8 - error TS1192: Module '"E:/picture-bed/node_modules/.pnpm/@types+lodash-es@4.17.12/node_modules/@types/lodash-es/index"' has no default export.
π Expected behavior
I expected to be able to use the syntax import _ from 'lodash-es'; without errors, as allowSyntheticDefaultImports should allow default imports for modules that do not have a default export.
Additional information about the issue
No response
π Search Terms
allowSyntheticDefaultImports
lodash-es
π Version & Regression Information
Version 4. x does not support 'moduleSolution': 'Bundler', so I only tried 5.6.2
β― Playground Link
https://github.com/bosens-China/picture-bed
π» Code
{ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, "resolveJsonModule": true, /* Bundler mode */ "moduleResolution": "Bundler", "allowImportingTsExtensions": true, "isolatedModules": true, "moduleDetection": "force", "noEmit": true, "jsx": "react-jsx", /* Linting */ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "baseUrl": ".", "paths": { "@/*": ["./src/*"] }, "esModuleInterop": true, "allowSyntheticDefaultImports": true }, "include": ["src"] }π Actual behavior
src/store/features/users/slice.ts:3:8 - error TS1192: Module '"E:/picture-bed/node_modules/.pnpm/@types+lodash-es@4.17.12/node_modules/@types/lodash-es/index"' has no default export.
π Expected behavior
I expected to be able to use the syntax import _ from 'lodash-es'; without errors, as allowSyntheticDefaultImports should allow default imports for modules that do not have a default export.
Additional information about the issue
No response