Ant-design-pro: deploy problem built with umi

Created on 15 Nov 2018  ·  6Comments  ·  Source: ant-design/ant-design-pro

Hi.
i just built scaffolded ant-design-pro project from here.
and i tried build then got /dist folder with index.html, umi.css, umi.js, chunks.

and i typed 'node ./dist/umi.js/'
but it's not working with this message.
"ReferenceError: window is not defined"

i think there is problem when bundle apps.
how do i solve it?

Most helpful comment

I have the similar issue, some solution ?

All 6 comments

Hi @epochchaser,
You can try with serve: npm i -g serve and then cd to the dist dir and run serve

Hi @epochchaser,
You can try with serve: npm i -g serve and then cd to the dist dir and run serve

thank you. it is working well.
but when i run app with server, there is 404 error almost every request.

I have similar issue with @epochchaser .
I use external API, and config proxy in config/config.js
Everything works fine when I run ant design pro with : npm run start:no-mock
But when I deploy in production:

npm run build
serve -s dist
  • when I access: localhost:5000/user/login : It's OK, but the login request do not send to API server. It uses API on localhost.
  • with nginx, when I access my domain: It shows nothing. It seems nginx cannot find the right directory.
    Please help.
    ant-design-pro

I have the similar issue, some solution ?

+++

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yoping picture Yoping  ·  3Comments

RichardStark picture RichardStark  ·  3Comments

lvzheng0404 picture lvzheng0404  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

happier2 picture happier2  ·  3Comments