Unable to access private github package with yarn during pages build

Hi,

I have a cloudflare pages app that is built automatically from changes to github, unfortunately after I’ve added use of private npm package, yarn install no longer works.

I’ve followed the article here - https://developers.cloudflare.com/pages/how-to/npm-private-registry#custom-registry-endpoints

Then following info is provided as part of preinstall (with removed tokens and private package name).

Wonder if anyone else have a resolution to such an issue ?

22:05:21.662	info yarn config
22:05:21.664	{
22:05:21.664	  'version-tag-prefix': 'v',
22:05:21.664	  'version-git-tag': true,
22:05:21.664	  'version-commit-hooks': true,
22:05:21.664	  'version-git-sign': false,
22:05:21.664	  'version-git-message': 'v%s',
22:05:21.664	  'init-version': '1.0.0',
22:05:21.664	  'init-license': 'MIT',
22:05:21.664	  'save-prefix': '^',
22:05:21.664	  'bin-links': true,
22:05:21.664	  'ignore-scripts': false,
22:05:21.664	  'ignore-optional': false,
22:05:21.664	  registry: 'https://registry.yarnpkg.com',
22:05:21.664	  'strict-ssl': true,
22:05:21.664	  'user-agent': 'yarn/1.22.10 npm/? node/v15.14.0 linux x64',
22:05:21.664	  version: '1.22.10'
22:05:21.664	}
22:05:21.664	info npm config
22:05:21.664	{
22:05:21.664	  tmp: '/opt/buildhome/tmp',
22:05:21.664	  'always-auth': true,
22:05:21.664	  registry: 'https://registry.yarnpkg.com',
22:05:21.664	  '@<private package>:registry': 'https://npm.pkg.github.com',
22:05:21.664	  '//npm.pkg.github.com/:_authToken': '<token that works locally>',
22:05:21.664	  version: '1.22.10',
22:05:21.664	  'version-commit-hooks': true,
22:05:21.664	  'user-agent': 'yarn/1.22.10 npm/? node/v15.14.0 linux x64',
22:05:21.664	  'bin-links': true,
22:05:21.664	  'init-version': '1.0.0',
22:05:21.664	  'init-license': 'MIT',
22:05:21.664	  'version-tag-prefix': 'v',
22:05:21.665	  'ignore-scripts': '',
22:05:21.665	  'version-git-message': 'v%s',
22:05:21.665	  argv: '{"remain":[],"cooked":["install"],"original":["install","--cache-folder","/opt/buildhome/.yarn_cache"]}',
22:05:21.665	  'version-git-tag': true,
22:05:21.665	  'version-git-sign': '',
22:05:21.665	  'strict-ssl': true,
22:05:21.665	  '_<private package>-registry': 'https://npm.pkg.github.com',
22:05:21.665	  'save-prefix': '^',
22:05:21.665	  'ignore-optional': ''
22:05:21.665	}
22:05:21.665	Done in 0.06s.
22:05:21.680	[1/4] Resolving packages...
22:05:21.908	[2/4] Fetching packages...
22:05:28.803	error An unexpected error occurred: "https://npm.pkg.github.com/download/@<private package>/1.4.0/b5ce33967a45ccb74f59b7abe795ed4706612989b53712d0bd2e9f529f006b98: Request failed \"401 Unauthorized\"".
22:05:28.803	info If you think this is a bug, please open a bug report with the information provided in "/opt/buildhome/repo/yarn-error.log".