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

使用ts时tsconfig.json文件配置module只能使用CommonJS,使用ES会报错 #5267

Open
kailiming opened this issue Nov 2, 2023 · 1 comment

Comments

@kailiming
Copy link

Your detail info about the Bug:

{
  "extends": "@eggjs/tsconfig",
  "compilerOptions": {
    "declaration": false,
    "paths": {
      "@/module/*": ["app/module/*"]
    },
    "baseUrl": ".",
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "module": "ES6",
    // "moduleResolution": "Node",
    // "target": "ES6",
    // "esModuleInterop": true
  }
}

我使用的第三方包node-fetch3只支持es模块化,所以无法使用。

Reproduction Repo

None

Node Version

18.16.1

Eggjs Version

3.15.0

Plugin Name and its version

"egg-mysql": "^4.0.0",     "egg-scripts": "^2.17.0",     "egg-tracer": "^2.0.0",

Platform and its version

win11

@fengmk2
Copy link
Member

fengmk2 commented Nov 2, 2023

对,目前 egg 只支持 commonjs。esm 还在进行中,估计是一个很长期的过程才能全链路支持。

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

2 participants