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 firstname.lastname@example.org: Please see https://github.com/lydell/urix#deprecated
[10:30:23.426] npm WARN deprecated email@example.com: See https://github.com/lydell/source-map-url#deprecated
[10:30:23.627] npm WARN deprecated firstname.lastname@example.org: https://github.com/lydell/resolve-url#deprecated
[10:30:23.653] npm WARN deprecated email@example.com: See https://github.com/lydell/source-map-resolve#deprecated
[10:30:28.953] npm WARN deprecated firstname.lastname@example.org: 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! https://www.npmjs.com/forgot
[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.
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.