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

Order of server start and handle mounts #62

Open
chrisrhymes opened this issue Apr 28, 2022 · 3 comments
Open

Order of server start and handle mounts #62

chrisrhymes opened this issue Apr 28, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@chrisrhymes
Copy link

chrisrhymes commented Apr 28, 2022

Describe the bug

I am trying to understand the order of operations in a deploy, as it seems to be out of sync. Is this correct?

  1. Build hook - yarn install, yarn build and copy .next to temp directory
  2. Start the next server
  3. Deploy hook - copies mounts back over .next directory

If correct, this means that the server has started with an old version of the .next directory and it could look for a particularly named js file in .next/server/pages, but once the deploy hook runs and the mount is updated, the js file may not exist anymore or be renamed, and the server returns an error.

Include some logs

Error: Cannot find module '/app/.next/server/pages/[...path].js'

Reproducing

We had a dynamic path pages/[...path]/index.tsx which was renamed pages/[[...path]]/index.tsx. After deploying to platform.sh it was still looking for [...path].js rather than the new [[...path]].js file.

Expected behavior

Mount the directories before starting the server so the server has access to the latest and correct .next directory.

Your environment

type: 'nodejs:14'

build:
  flavor: none

Screenshots

No response

Additional context

No response

@apfelbox
Copy link

I have the same issue. I already kill and auto-restart the process, but this doesn't work reliably and therefore we have frequent deploys without assets.

@dottodot
Copy link

Yes seeing the same issue, seems very inconsistent and sometimes results in a broken site

@apfelbox
Copy link

@dottodot you can try this command, as it seems to work way more reliable for us: #468

systemctl --user restart app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants