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

[BUG] 项目启动提示堆内存溢出错误导致启动失败 #20

Closed
resetsix opened this issue Sep 20, 2023 · 1 comment
Closed

[BUG] 项目启动提示堆内存溢出错误导致启动失败 #20

resetsix opened this issue Sep 20, 2023 · 1 comment

Comments

@resetsix
Copy link

描述

CRA脚手架初始化后,按照官网教程yarn add @codeblitzjs/ide-core安装 IDE 组件。导入组件后启动报错,原因是堆内存溢出(电脑内存并没有占满)。

作为对比测试,我导入Hello组件能正常启动;而App组件使用的官网完整示例。App组件启动(命令yarn start)就堆内存溢出。根据gpt提示使用yarn start --max-old-space-size=4096也还是报相同的错。

图片

图片

依赖版本

图片

复现代码

https://github.com/resetsix/CodeBlitz

@AhkunTa
Copy link
Member

AhkunTa commented Oct 7, 2023

内存溢出问题 应该和项目没关系 可以在扩大下 内存 --max-old-space-size=8192 试下
除此之外 示例项目还有部分配置项需要改动

截屏2023-10-07 18 47 17

以下是具体的package.json

{
  "name": "ide",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@codeblitzjs/ide-core": "^1.0.4",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.18.53",
    "@types/react": "^18.2.22",
    "@types/react-dom": "^18.2.7",
    "node-gyp": "^9.4.0",
    "react": "^16.14.0",
    "react-dom": "^16.14.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.9.5",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "resolutions": {
    "electron": "^18.3.0"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

@AhkunTa AhkunTa closed this as completed Oct 11, 2023
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