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# build 功能出问题了 #1538

Closed
smithyj opened this issue Nov 28, 2018 · 1 comment
Closed

#BUG# build 功能出问题了 #1538

smithyj opened this issue Nov 28, 2018 · 1 comment

Comments

@smithyj
Copy link
Contributor

smithyj commented Nov 28, 2018

@sorrycc

问题说明

dev 是可以正常运行的,npm start 可以正常启动 build 就会挂

复现项目:https://github.com/smithyj/manage.yangyj.com

复现过程

npm 方式

git clone https://github.com/smithyj/manage.yangyj.com.git && cd manage.yangyj.com && npm install && npm run build

yarn 方式

git clone https://github.com/smithyj/manage.yangyj.com.git && cd manage.yangyj.com && yarn install && npm run build

复现结果

> manage.yangyj.com@0.0.1 build /Users/yyj/Docker/wwwroot/manage.yangyj.com
> umi build

/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/routes/routesToJSON.js:48
        if (value.startsWith('() =>')) {
                  ^

TypeError: Cannot read property 'startsWith' of undefined
    at Object.JSON.stringify (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/routes/routesToJSON.js:48:19)
    at JSON.stringify (<anonymous>)
    at _default (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/routes/routesToJSON.js:45:15)
    at FilesGenerator.getRoutesJSON (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/FilesGenerator.js:275:38)
    at FilesGenerator.getRouterJSContent (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/FilesGenerator.js:237:54)
    at FilesGenerator.generateRouterJS (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/FilesGenerator.js:226:32)
    at FilesGenerator.generateFiles (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/FilesGenerator.js:136:10)
    at FilesGenerator.generate (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/FilesGenerator.js:58:10)
    at api.registerCommand (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/plugins/commands/build/index.js:34:20)
    at Service.run (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi-build-dev/lib/Service.js:346:12)
    at Object.<anonymous> (/Users/yyj/Docker/wwwroot/manage.yangyj.com/node_modules/umi/lib/scripts/build.js:14:47)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
@sorrycc
Copy link
Member

sorrycc commented Nov 28, 2018

可以先这么绕过,

- { path: '/404', redirect: '/exception/404', hideMenu: true },
+ { path: '/404', component: '/Exception/404', hideMenu: true },

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

No branches or pull requests

2 participants