-
Notifications
You must be signed in to change notification settings - Fork 14
Description
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?
- Build hook - yarn install, yarn build and copy .next to temp directory
- Start the next server
- 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: noneScreenshots
No response
Additional context
No response