Skip to content

Getting TS Error 2604 with package.json type="module" #739

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

Open
andreash opened this issue May 6, 2023 · 0 comments
Open

Getting TS Error 2604 with package.json type="module" #739

andreash opened this issue May 6, 2023 · 0 comments

Comments

@andreash
Copy link

andreash commented May 6, 2023

My code is

import React from "react";
import Tree from "rc-tree";
export function S() {
    return <Tree>
    </Tree>
}

My package.json is

{
  "type": "module",
  "dependencies": {
    "@commander-js/extra-typings": "^10.0.3",
    "@types/react": "^18.2.5",
    "minimist2": "^1.0.2",
    "rc-tree": "^5.7.3",
    "react": "^18.2.0",
    "ts-command-line-args": "^2.5.0",
    "yargs": "^17.7.1"
  },
  "devDependencies": {
    "@types/node": "^18.15.11",
    "@types/yargs": "^17.0.24"
  }
}

I am getting a TS Error 2604, when I compile this. If I change type in package.json to "commonjs" or leave it out, the code compiles fine. How can I make it error free when using type="module" - which I need for other reasons.

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

1 participant