How does production deployment work?

This feels like a dumb question but I don't understand how production deployments work with Prismic.

In local, the API has you log into the browser--but I can't find information on how that works when deploying to production with my app. I can't exactly have Vercel let me log me into a browser window and the documents seem to just gloss over it just working.

My build fails with an error "npm ERR! Incorrect or missing password." and my guess is this is from Prismic.

Could anyone explain how this works, please?

This is the error I get when deploying to Vercel--following the Prismic NextJS docs:

[10:30:11.116] Cloning completed: 422.746ms
[10:30:11.448] Installing build runtime...
[10:30:14.471] Build runtime installed: 3.022s
[10:30:15.214] Looking up build cache...
[10:30:15.484] Build Cache not found
[10:30:15.691] Installing dependencies...
[10:30:15.698] Detected `package-lock.json` generated by npm 7...
[10:30:22.930] npm WARN deprecated urix@0.1.0: Please see
[10:30:23.426] npm WARN deprecated source-map-url@0.4.1: See
[10:30:23.627] npm WARN deprecated resolve-url@0.2.1:
[10:30:23.653] npm WARN deprecated source-map-resolve@0.5.3: See
[10:30:28.953] npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
[10:30:38.654] npm ERR! code E401
[10:30:38.655] npm ERR! Incorrect or missing password.
[10:30:38.656] npm ERR! If you were trying to login, change your password, create an
[10:30:38.656] npm ERR! authentication token or enable two-factor authentication then
[10:30:38.656] npm ERR! that means you likely typed your password in incorrectly.
[10:30:38.656] npm ERR! Please try again, or recover your password at:
[10:30:38.657] npm ERR!
[10:30:38.657] npm ERR! 
[10:30:38.657] npm ERR! If you were doing some other operation then your saved credentials are
[10:30:38.657] npm ERR! probably out of date. To correct this please try logging in again with:
[10:30:38.657] npm ERR!     npm login
[10:30:38.658] npm ERR! A complete log of this run can be found in:
[10:30:38.658] npm ERR!     /vercel/.npm/_logs/2022-04-19T14_30_15_922Z-debug-0.log
[10:30:38.682] Error: Command "npm install" exited with 1

Hey @dhayes, maybe you need to build your project before trying to deploy the changes. Sometimes the project can work perfectly in dev mode, and it's only after building you can identify if something is missing.

1 Like

I appreciate the reply. It does the build command as part of the deployment.

After looking through a lot of threads of possibly related things I was able to get deployment to work by deleting the package-lock file. For whatever reason, it ONLY works when it's not included.

I'd still like to understand, though, how Prismic's updated next client works for deployment. The official docks don't mention creating an access token (they do for vanilla JS but not Next JS). I ended up adding one anyway when I was trying to troubleshoot--but I haven't really confirmed if it's doing anything just yet.