data-set icon indicating copy to clipboard operation
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.

Open dasoncheng opened this issue 3 years ago • 6 comments

  • 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,
  }
}

image

dasoncheng avatar Sep 03 '20 10:09 dasoncheng

怎么解决?

nxboo avatar Oct 26 '20 09:10 nxboo

同问

nxboo avatar Oct 26 '20 09:10 nxboo

import DataSet from '@antv/data-set';

const dv= new DataSet.DataView();

net027 avatar Nov 23 '20 12:11 net027

同问这个解决了吗,加了"esModuleInterop": true也没效果

CharlesChanV avatar Sep 24 '21 06:09 CharlesChanV

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编译器下才可以

Mimiokish avatar Jan 29 '23 07:01 Mimiokish

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

Mimiokish avatar Jan 29 '23 07:01 Mimiokish