Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export. #93

Open
dasoncheng opened this issue Sep 3, 2020 · 6 comments

Comments

@dasoncheng
Copy link

  • 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

@nxboo
Copy link

nxboo commented Oct 26, 2020

怎么解决?

@nxboo
Copy link

nxboo commented Oct 26, 2020

同问

@net027
Copy link

net027 commented Nov 23, 2020

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

const dv= new DataSet.DataView();

@CharlesChanV
Copy link

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

@Mimiokish
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants