本地启动choerodon-front前端报错

  • Choerodon平台版本:0.19.0

  • 运行环境(如localhost或k8s):localhost

  • 遇到问题时的前置条件:本地启动前端代码

  • 问题描述:

    在 choerodon-front 下执行 npm install 成功完毕后,执行 npm run start
    最后 显示如下信息:

"D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run start --scripts-prepend-node-path=auto
Debugger listening on ws://127.0.0.1:50995/361c8e20-e758-472c-9a6d-ef23074ac65d
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.

> @choerodon/choerodon-front@0.19.0 start D:\devops\choerodon-front
> choerodon-front-boot start --config ./react/localconfig.js

Debugger listening on ws://127.0.0.1:50997/58cee594-18a3-47e6-afde-dd042e077eb4
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:50999/0cb927b7-452c-4a8e-8536-cdbc4395786a
For help, see: https://nodejs.org/en/docs/inspector
�  building modules (150/162 modules)(node:21772) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/i
ssues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
�  building modules (7666/7666 modules)Extracted theme color css content length: 36381
webpack: bundle build is now finished.
 WARNING  Compiled with 2 warnings                                                                                                                                                       6:04:48 PM

These dependencies were not found:

* @choerodon/buzz-saas/lib/routes/cooperate-side in ./node_modules/@choerodon/knowledge/lib/routes/page/doc/DocHome.js
* @choerodon/buzz/lib/routes/cooperate-side in ./node_modules/@choerodon/knowledge/lib/routes/page/doc/DocHome.js

To install them, you can run: npm install --save @choerodon/buzz-saas/lib/routes/cooperate-side @choerodon/buzz/lib/routes/cooperate-side
Waiting for the debugger to disconnect...

Process finished with exit code 1
  • 访问localhost:9090页面出不来

能不能看一下你配的的localconfig文件

const config = {
  local: true, //是否为本地开发
  theme: {
    'primary-color': '#3F51B5',
  },
  clientId: 'client_id', // 必须填入响应的客户端(本地开发)
  cookieServer: '', //子域名token共享
  titlename: 'Choerodon | 多云应用技术集成平台',
  server: 'http://localhost:8080',
  fileServer: 'http://localhost:3333',
  webSocketServer: 'http:localhost:18085',
  buildType: 'single',
  projectType: 'choerodon',
  master: './node_modules/@choerodon/master/lib/master.js',
  modules: [
    '@choerodon/base',
    '@choerodon/asgard',
    '@choerodon/notify',
    '@choerodon/manager',
    "@choerodon/agile",
    "@choerodon/testmanager",
    "@choerodon/knowledge",
    "@choerodon/devops",
  ],
  resourcesLevel: ['site', 'organization', 'project', 'user'],
  outward: '/knowledge/share',
};

module.exports = config;

访问localhost:9090浏览器控制台报错信息如下

TypeError: "window._env_ is undefined"
    isInOutward http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1
    value http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1
    w http://192.168.244.128:3310/dis/index.dd3ce643.js:1
    a http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1
    tn http://192.168.244.128:3310/dis/index.dd3ce643.js:1
    track http://192.168.244.128:3310/dis/index.dd3ce643.js:1
    a http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1
    render http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1
    render http://192.168.244.128:3310/dis/chunks/0.db278.chunk.js:1