data-set
data-set copied to clipboard
This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
- Link:
- Platform: macOS: 10.15.6 nodejs: 14.0.0 angular: 10.0.14 @antv/data-set: 0.11.5
- Mini Showcase(like screenshots):
tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
}
}
怎么解决?
同问
import DataSet from '@antv/data-set';
const dv= new DataSet.DataView();
同问这个解决了吗,加了"esModuleInterop": true也没效果
quick fix, here is my tsconfig.json
{ "compilerOptions": { "module": "ESNext", "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true }, "ts-node": { "compilerOptions": { "module": "CommonJS", } }, "exclude": [ "node_modules", "**/*.json", "public/**/*" ], "include": [ "src/**/*.ts", "webpack.config.ts" ] }
should have your problem fixed. make sure you add moduleResolution/esModuleInterop/allowSyntheticDefaultImports under where your ES complier is.
试试上面这个配置方式,应该能修复你们的问题。要确保你moduleResolution/esModuleInterop/allowSyntheticDefaultImports放在ES编译器下才可以
quick fix, here is my tsconfig.json
{ "compilerOptions": { "module": "ESNext", "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true }, "ts-node": { "compilerOptions": { "module": "CommonJS", } }, "exclude": [ "node_modules", "**/*.json", "public/**/*" ], "include": [ "src/**/*.ts", "webpack.config.ts" ] }
should have your problem fixed. make sure you add moduleResolution/esModuleInterop/allowSyntheticDefaultImports under where your ES complier is.
试试上面这个配置方式,应该能修复你们的问题。要确保你moduleResolution/esModuleInterop/allowSyntheticDefaultImports放在ES编译器下才可以
@nxboo @CharlesChanV