For Workers & Pages, what is the name of the domain?
Not deployed yet
What is the issue or error you’re encountering
I was able to set up my Nextjs project in Cloudflare but the preview is failing because is not loading the npm token in the build
What steps have you taken to resolve the issue?
I set up the npm token as a secret in the preview and production tabs
When I create a new PR the preview build is running and it fails with 401 because the token is undefined. I think the problem is that you need a wrangler to make Next works with CF Pages and this is not allowing secrets in the dashboard
If I merge the PR to main branch the deployment works well, the problem is the preview. I would like to have the preview branch URL on every PR.
What are the steps to reproduce the issue?
Set up a Nextjs project with a npm private package and set a secret for it.
Run the install in local so you check it works.
Deploy your project in CF Pages, set the secret for the preview tab in the dashboard.
When you run the preview deployment the packages installation will fail because the env var is undefined.