antvis/G2

Failing to correctly install G2v5 #4508

cd-alexslater posted onGitHub

Hello everyone,

Here is a repo reproducing the issue: https://github.com/cd-alexslater/reproductions

I've been trying to install v5 of G2, but I'm encountering a number of errors in the d.ts files for G2 (see below for a few of them). <img width="1135" alt="image" src="https://user-images.githubusercontent.com/114569661/208921457-7d021f21-f755-44fd-91b5-7342348aa4b9.png">

That error about ActionComponent is particularly confusing as you'll see that typing used to be exported from the index of the module it's being imported from but is now commented out: <img width="396" alt="image" src="https://user-images.githubusercontent.com/114569661/208922739-27b53b8c-5718-4170-bd75-e8e775b95d35.png">

There's also an error there about importing from 'spec'.. If you change the import to '../spec' it goes away. (this makes sense because spec is a folder up from that file)

Perhaps it's something obvious that I'm missing? Is there some incompatibility with my tsconfig module resolution / target I should be aware of?


There are some issues related to types in G2 now. You can update tsconfig.json as follows to solve most of the errors:

{
  "compilerOptions": {
    "target": "es5",
    "moduleResolution": "node",
    "lib": ["dom", "esnext"],
    "esModuleInterop": true,
  }
}

Then there are two left to be solved in G2:

image

You can now set compilerOptions.skipLibCheck to true to skip these issues temporarily.

{
  "compilerOptions": {
    "target": "es5",
    "skipLibCheck": true,
  }
}

I will open a pull request to fix the remaining errors.

posted by pearmini over 2 years ago

Fund this Issue

$0.00
Funded

Pull requests