'400 error when importing a new JSS app to Sitecore 10.2

When trying to import a newly generated JSS application into Sitecore, the jss deploy items command returns the following error: Unexpected response from import service: Status message: Bad Request Status: 400

Version info: Sitecore version 10.02 JSS Version: 19.0

  • I used the --branch release/19.0.0 parameter when creating the JSS application to ensure the correct framework version.
  • Sitecore is running on another server on the network.
  • I've created a file share on the Sitecore server and specified it for jss setup which otherwise warns that jss deploy config, jss deploy files, and jss deploy app cannot be used with remote Sitecore.
  • When I first received the 400 error, the server admin added the IIS app pool user to the "Performance Monitor Users" & "Performance Log Users" groups per This Stackoverflow question, but this didn't help.
  • When running the JSS command, I'm logged in with my corporate network (Windows) ID on my local PC. In Sitecore, there is are Sitecore Admin and test user accounts. Does my corporate network account need to be mapped to a Sitecore account?


Solution 1:[1]

I resolved this error when I discovered that I was using an incorrect entry for the Sitecore hostname. When I corrected it so that it mapped to the path to the Sitecore folder, I no longer receive the 400 error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dan_K22