You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2019/12/28 10:25:28 UTC
[GitHub] [incubator-apisix-dashboard] jiezaizone opened a new issue #108: npm run build 后访问异常
jiezaizone opened a new issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108
直接你`npm run serve` 访问正常,但是`npm run build` 后启动就访问异常
![image](https://user-images.githubusercontent.com/28976666/71542251-0e057900-299f-11ea-972e-715b3373287e.png)
![image](https://user-images.githubusercontent.com/28976666/71542273-5de44000-299f-11ea-9ea6-9eab00862020.png)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569469258
是 `npm run build:prod` 吧
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569873055
> ![image](https://user-images.githubusercontent.com/2106987/71566234-de668600-2af0-11ea-8879-053cf5c8a045.png)
>
> It seems some files cannot retrieve.
nginx.conf
```
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-570182140
If any related issues found, welcome to reopen this issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569566970
![image](https://user-images.githubusercontent.com/2106987/71566234-de668600-2af0-11ea-8879-053cf5c8a045.png)
It seems some files cannot retrieve.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-570181978
FYI: After several discussions offline, this issue is related to the default setting under `vue.config.js` file. Please set `publicPath` to `/` before `run build` if your dashboard is not under `/apisix/dashboard` directory.
![image](https://user-images.githubusercontent.com/2106987/71664885-b8154480-2d95-11ea-9919-2542cf04ca24.png)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569876937
我特意拿了一台新的服务器测试一下,还是一样的问题。
新的服务器,新拉的代码,直接`yarn install && yarn run build:prod`,运行还是一样的问题。
我自己mac、服务器centos7都是一样的。
![image](https://user-images.githubusercontent.com/28976666/71612805-b012a480-2bdd-11ea-9205-334aafa7fcb0.png)
![image](https://user-images.githubusercontent.com/28976666/71612780-907b7c00-2bdd-11ea-9c1c-cc7c231cef8b.png)
![image](https://user-images.githubusercontent.com/28976666/71612837-e8b27e00-2bdd-11ea-8ac3-c37308648b40.png)
![image](https://user-images.githubusercontent.com/28976666/71612826-ca4c8280-2bdd-11ea-99c8-226ed81bd884.png)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569471951
> 是 `npm run build:prod` 吧
我自己不想输入prod 修改了命令。实际执行了`npm run build:prod`。
```
FROM alpine:latest AS build-stage
MAINTAINER jiezai
# create destination directory
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app
# install nodejs
RUN apk add --no-cache --update nodejs nodejs-npm git yarn
RUN git clone https://github.com/apache/incubator-apisix-dashboard.git
WORKDIR /usr/src/app/incubator-apisix-dashboard
RUN yarn install
RUN yarn run build:prod
FROM docker.oa.isuwang.com:5000/system/nginx:1.10.1 as production-stage
MAINTAINER jiezai
RUN mkdir /app
COPY --from=build-stage /usr/src/app/incubator-apisix-dashboard/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
```
新打了镜像访问报错,本地就更新了代码试一下,果然一样的异常,你们可以试一下。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
Re: [GitHub] [incubator-apisix-dashboard] jiezaizone edited a comment on issue #108: npm run build 后访问异常
Posted by Zhiyuan Ju <ju...@apache.org>.
Please try this way:
Open browser then force refresh cache: Command + shift + R on Chrome based
Mac OS, Shift + F5 based on Windows I guess.
I'm out for journey these days, and will try to reproduce this issue when I
have time.
GitBox <gi...@apache.org> 于 2019年12月29日周日 11:58写道:
> jiezaizone edited a comment on issue #108: npm run build 后访问异常
> URL:
> https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569471951
>
>
> > 是 `npm run build:prod` 吧
>
> 我自己不想输入prod 修改了命令。实际执行了`npm run build:prod`。
> ```
> FROM alpine:latest AS build-stage
> MAINTAINER jiezai
> # create destination directory
> RUN mkdir -p /usr/src/app/
> WORKDIR /usr/src/app
> # install nodejs
> RUN apk add --no-cache --update nodejs nodejs-npm git yarn
>
> RUN git clone https://github.com/apache/incubator-apisix-dashboard.git
> WORKDIR /usr/src/app/incubator-apisix-dashboard
> RUN yarn install
> RUN yarn run build:prod
>
> FROM XXX:5000/system/nginx:1.10.1 as production-stage
> MAINTAINER jiezai
> RUN mkdir /app
> COPY --from=build-stage /usr/src/app/incubator-apisix-dashboard/dist
> /app
> COPY nginx.conf /etc/nginx/nginx.conf
> CMD ["nginx", "-g", "daemon off;"]
>
> ```
> 新打了镜像访问报错,本地就更新了代码试一下,果然一样的异常,你们可以试一下。
>
> ----------------------------------------------------------------
> This is an automated message from the Apache Git Service.
> To respond to the message, please log on to GitHub and use the
> URL above to go to the specific comment.
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>
> With regards,
> Apache Git Services
>
[GitHub] [incubator-apisix-dashboard] jiezaizone edited a comment on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone edited a comment on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569471951
> 是 `npm run build:prod` 吧
我自己不想输入prod 修改了命令。实际执行了`npm run build:prod`。
```
FROM alpine:latest AS build-stage
MAINTAINER jiezai
# create destination directory
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app
# install nodejs
RUN apk add --no-cache --update nodejs nodejs-npm git yarn
RUN git clone https://github.com/apache/incubator-apisix-dashboard.git
WORKDIR /usr/src/app/incubator-apisix-dashboard
RUN yarn install
RUN yarn run build:prod
FROM XXX:5000/system/nginx:1.10.1 as production-stage
MAINTAINER jiezai
RUN mkdir /app
COPY --from=build-stage /usr/src/app/incubator-apisix-dashboard/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
```
新打了镜像访问报错,本地就更新了代码试一下,果然一样的异常,你们可以试一下。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569565615
@jiezaizone I tried on my local machine, no error occurred. @membphis could you please help to deploy the latest dashboard on `http://apisix.iresty.com/apisix/dashboard/`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan closed issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan closed issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] jiezaizone commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-570110761
> jushaoyao
已经添加。你可以试试dockerfile构建镜像,nginx就是普通的nginx,
https://cli.vuejs.org/zh/guide/deployment.html#docker-nginx
拿的是vue提供的dockerfile 和nginx。就是使用的node被我改成alpine:latest 而已。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-570067208
could you add my wechat (jushaoyao)? so we could use TeamViewer to debug this issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] jiezaizone edited a comment on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
jiezaizone edited a comment on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569471951
> 是 `npm run build:prod` 吧
我自己不想输入prod 修改了命令。实际执行了`npm run build:prod`。
```
FROM alpine:latest AS build-stage
MAINTAINER jiezai
# create destination directory
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app
# install nodejs
RUN apk add --no-cache --update nodejs nodejs-npm git yarn
RUN git clone https://github.com/apache/incubator-apisix-dashboard.git
WORKDIR /usr/src/app/incubator-apisix-dashboard
RUN yarn install
RUN yarn run build:prod
FROM nginx as production-stage
MAINTAINER jiezai
RUN mkdir /app
COPY --from=build-stage /usr/src/app/incubator-apisix-dashboard/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]
```
新打了镜像访问报错,本地就更新了代码试一下,果然一样的异常,你们可以试一下。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix-dashboard] juzhiyuan edited a comment on issue #108: npm run build 后访问异常
Posted by GitBox <gi...@apache.org>.
juzhiyuan edited a comment on issue #108: npm run build 后访问异常
URL: https://github.com/apache/incubator-apisix-dashboard/issues/108#issuecomment-569565615
@jiezaizone I tried on my local machine, no error occurred. Anyway, I will try your Dockerfile ASAP.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services