vscodeからNext.js 14系をデプロイする際にPHPプロジェクトとして認識されデプロイが失敗する

00065233 0 Reputation points
2024-03-13T04:48:19.2733333+00:00

Github等のDevOpsを使用せずにVScodeのみでNext.jsのアプリをデプロイしたい

  • Next.js14系のアプリケーションをデプロイする際にOryxのビルドが実行され、Detecting platformsで自動認識されるところでPHPプロジェクトと認識され、デプロイが失敗します。

こちらがエラーログです。

14:26:05 next-auth-test: Zip package size: 180 MB
14:26:08 next-auth-test: Fetching changes.
14:26:09 next-auth-test: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/6a37c6e0-976f-4e6e-a025-5997fdc7f5ae.zip (171.58 MB) to /tmp/zipdeploy/extracted
14:26:24 next-auth-test: Updating submodules.
14:26:25 next-auth-test: Preparing deployment for commit id 'e0ca5b5b-1'.
14:26:25 next-auth-test: PreDeployment: context.CleanOutputPath False
14:26:25 next-auth-test: PreDeployment: context.OutputPath /home/site/wwwroot
14:26:25 next-auth-test: Repository path is /tmp/zipdeploy/extracted
14:26:25 next-auth-test: Running oryx build...
14:26:25 next-auth-test: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log  -i /tmp/8dc431e20791561 -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
14:26:26 next-auth-test: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
14:26:26 next-auth-test: You can report issues at https://github.com/Microsoft/Oryx/issues
14:26:26 next-auth-test: Oryx Version: 0.2.20230829.1, Commit: 5bd3088141516cdbd815d62ada052654e91f0429, ReleaseTagName: 20230829.1
14:26:26 next-auth-test: Build Operation ID: 746b1541f7852dd4
14:26:26 next-auth-test: Repository Commit : e0ca5b5b-1480-4aaa-9b37-0e856da4e87a
14:26:26 next-auth-test: OS Type           : bookworm
14:26:26 next-auth-test: Image Type        : githubactions
14:26:26 next-auth-test: Detecting platforms...
14:26:33 next-auth-test: Error: Platform 'php' version '8.0' is unsupported. Supported versions: 8.1.22, 8.2.16, 8.2.9, 8.1.22, 8.2.16, 8.2.9
14:26:40 next-auth-test: Deployment failed.

ed.

フォルダ構成としては

  • workspace .vscode test-app app prisma types .env package.json
        
    

となっています。

試したこと

  • vscodeフォルダの位置をtest-app配下に置く
  • .deploymentフォルダにprojectのコンフィグを記載する
  • .deploymentフォルダにcommandコンフィグを記載し、npm install及びnpm run buildを実行する デプロイ自体は成功するが、wwwroot配下にプロジェクトが置かれないため、アプリの起動は不可
  • .deploymentフォルダにDISABLE_HUGO_BUILD=trueを記載する
  • setting.jsonを変更する
  • リモートビルド時
      {
        "appService.zipIgnorePattern": ["node_modules{,/**}", ".vscode{,/**}"],
        "appService.showBuildDuringDeployPrompt": true
      }
      
      
    
  • ローカルビルド時
      {
        "appService.showBuildDuringDeployPrompt": false,
        "appService.preDeployTask": "npm: build"
      }
      
      
    
      {
        "version": "2.0.0",
        "tasks": [
          {
            "type": "npm",
            "script": "install",
            "group": "build",
            "problemMatcher": [],
            "label": "npm: install",
            "detail": "install dependencies from package",
            "options": {
              "cwd": "${workspaceFolder}/test-app"
            }
          },
          {
            "type": "npm",
            "script": "build",
            "group": "build",
            "problemMatcher": [],
            "label": "npm: build",
            "detail": "next build",
            "dependsOn": ["npm: install"],
            "options": {
              "cwd": "${workspaceFolder}/test-app"
            }
          }
        ]
      }
      
      
    
  • ローカルビルドするとファイルのコピーが1時間以上経過しても終了しない

リモートビルド時にpackage.jsonがあるにもかかわらず、PHPプロジェクトと認識される理由やその解決策を探りたいです。

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
823 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
896 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenLiu-MSFT 40,001 Reputation points Microsoft Vendor
    2024-03-13T06:04:19.37+00:00

    Hi, @00065233

    Thank you for posting in Microsoft Q&A forum.

    Here is the place for English language, you may need to ask your question in Japanese place:

    https://learn.microsoft.com/ja-jp/answers/questions/

    And you added the tag Microsoft Deployment Toolkit and Microsoft Configuration Manager Deployment, is your question related to MDT or MECM? If not, you may add the corresponding tag so that the experts who are familiar with that topic may help.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".

    1 person found this answer helpful.
    0 comments No comments