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

angular构建G6时Type expected问题 #5638

Open
Yyoneqweqwe opened this issue Apr 12, 2024 · 5 comments
Open

angular构建G6时Type expected问题 #5638

Yyoneqweqwe opened this issue Apr 12, 2024 · 5 comments
Labels

Comments

@Yyoneqweqwe
Copy link

在angular中启动G6
image

  • 我查的是要升级TS版本,升级到typescript@4.2.4说是可以解决问题,但是升级后
    1712893188301

又出现了这个问题,有大佬知道更好的解决方法

Copy link

dosubot bot commented Apr 12, 2024

To address the TypeScript compilation errors and memory allocation issues you're encountering with G6 in Angular, consider the following steps:

  1. Upgrade TypeScript: Ensure your TypeScript version matches the one used by G6. If G6 is using a newer version, such as 5.3.3, upgrading to this version might resolve the type-related errors.

  2. Increase Node.js Memory Limit: The memory allocation error (ENOMEM) suggests the TypeScript compiler is running out of memory. Increase the memory limit by setting the NODE_OPTIONS environment variable. For a 4 GB limit, use:

    export NODE_OPTIONS=--max_old_space_size=4096
  3. Optimize TypeScript Compilation: Modify your tsconfig.json to include "incremental": true under compilerOptions. This optimizes the compilation process by reusing information from previous compilations, reducing memory usage and speeding up build times.

Here's an example snippet for your tsconfig.json:

{
  "compilerOptions": {
    ...
    "incremental": true,
    ...
  }
}

These steps are targeted solutions based on the issues you've described. Upgrading TypeScript can help with compatibility and type errors, while adjusting the Node.js memory limit and optimizing the TypeScript compiler settings can mitigate memory allocation issues during the build process.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@hustcc
Copy link
Member

hustcc commented Apr 12, 2024

这个感觉是 ts 版本问题吧。

@Yyoneqweqwe
Copy link
Author

这是感觉版本问题吧。

是ts版本问题,提升typescript版本但是超出了包的范围,版本低了又运行不了

@Aarebecca
Copy link
Contributor

确认下你的 angular 版本呢,要求 < 4.0.0 挺奇怪的,这个版本应该比较旧了吧

@Yyoneqweqwe
Copy link
Author

确认下你的角度版本呢,要求 < 4.0.0 应该挺奇怪的,这个版本比较旧吧
1712901772784
10.0.4的版本,跟这个有关嘛?

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

No branches or pull requests

3 participants