Can't deploy Next.js SSR app
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I can't for the life of me figure out how to deploy Next.js SSR app. Tried every possible combination, with standalone output or not:
```yml
#- script: yarn build
# displayName: 'Build'
- task: AzureStaticWebApp@0
displayName: 'Deploy to Azure Static Web Apps'
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN)
app_location: '/'
api_location: ''
output_location: ''
app_build_command: yarn build && npm pkg set packageManager=yarn@3.6.0
env:
PRE_BUILD_COMMAND: corepack enable
```
Not only this uses Yarn 3 for build and Yarn 1 for deploy parts (completely fails to detect `.yarnrc.yml` which is supposed to detect modern version of Yarn), but ends up with an error:
```
The content server has rejected the request with: BadRequest
Reason: The size of the function content was too large. The limit for this Static Web App is 104857600 bytes.
```
Tried this with custom build:
```yml
- script: yarn build
displayName: 'Build'
- task: AzureStaticWebApp@0
displayName: 'Deploy to Azure Static Web Apps'
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN)
skip_app_build: true
app_location: ''
output_location: ''
```
and:
```yml
- script: yarn build
displayName: 'Build'
- task: AzureStaticWebApp@0
displayName: 'Deploy to Azure Static Web Apps'
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN)
skip_app_build: true
app_location: '.next'
output_location: ''
```
and also:
```yml
- script: yarn build
displayName: 'Build'
- task: AzureStaticWebApp@0
displayName: 'Deploy to Azure Static Web Apps'
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN)
skip_app_build: true
app_location: '.next/standalone'
output_location: ''
```
and got:
```
App Directory Location: '.next' is invalid. Could not detect this directory. Please verify your deployment configuration file reflects your repository structure.
```
or:
```
Failed to find a default file in the app artifacts folder (.next). Valid default files: index.html,Index.html.
If your application contains purely static content, please verify that the variable 'app_location' in your deployment configuration file points to the root of your application.
If your application requires build steps, please validate that a default file exists in the build output directory.
```
**Expected behavior**
Next.js application to deploy
**Device info (if applicable):**
- OS: [e.g. iOS] n/a
- Browser [e.g. chrome, safari] n/a
- Version [e.g. 22] n/a
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.