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

Updating from 3.3.12 to 4.0.0 breaks our production deployment #1970

Closed
Glinkis opened this issue Oct 19, 2020 · 6 comments
Closed

Updating from 3.3.12 to 4.0.0 breaks our production deployment #1970

Glinkis opened this issue Oct 19, 2020 · 6 comments
Labels

Comments

@Glinkis
Copy link

Glinkis commented Oct 19, 2020

After upgrading from 3.3.12 to 4.0.0, we get 404 for our index.html page.
We're using serve inside a docker container to serve our app in production.
If I do a local build, and run serve, everything works as expected.

Our dockerfile looks like this:

FROM node:12.16

# Copy only the files relevant to the installation
COPY ./yarn.lock /
COPY ./package.json /
COPY ./packages/babel/package.json /packages/babel/package.json
COPY ./packages/webapp/package.json /packages/webapp/package.json
COPY ./packages/shared/package.json /packages/shared/package.json

# Install dependencies recursively for all packages
RUN yarn install --frozen-lockfile

# Copy the rest of the directory
COPY ./ /

ARG NODE_ENV
ENV NODE_ENV=$NODE_ENV
ARG API_URL
ENV API_URL=$API_URL

WORKDIR /packages/webapp

RUN export NODE_ENV=$NODE_ENV && export API_URL=$API_URL && yarn build

EXPOSE 8080

CMD ["yarn", "serve"]

The "serve" script is "serve": "serve -l 8080 -c ../serve.json",

And the serve config like this:

{
  "public": "dist",
  "directoryListing": false,
  "rewrites": [
    {
      "source": "/static/**",
      "destination": "/static"
    },
    {
      "source": "/**",
      "destination": "/index.html"
    }
  ]
}
@Glinkis Glinkis added the Bug label Oct 19, 2020
@alexander-akait
Copy link
Member

Sorry don't know, I don't know what your configuration mean, for running serve you need write webpack serve, we never support json config in this format

@Glinkis
Copy link
Author

Glinkis commented Oct 19, 2020

I wrote that we're using the serve package, not webpack serve. If you're going to answer, please read the full description.

@alexander-akait
Copy link
Member

Sorry, serve is not related to webpack-cli, so I don't know why it does not work, if you want to help, please use the issue template and describe your problems, Updating from 3.3.12 to 4.0.0 breaks our production deployment is not help to solve your problem

@Glinkis
Copy link
Author

Glinkis commented Oct 19, 2020

I thought I described my problem quite thoroughly. I'm not sure what else to add?

@alexander-akait
Copy link
Member

@Glinkis please create minimum reproducible test repo, I don't know what your Docker file do

@Glinkis
Copy link
Author

Glinkis commented Oct 20, 2020

It seems my issue was that the --env flag was changed in version 4. So I fixed it by following the advice in #1216

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

No branches or pull requests

2 participants