"Apple Sign-in button not working on Heroku web app: troubleshooting help needed"

I am trying to implement the Apple Sign-In feature on my web app, which is deployed on Heroku. However, I am encountering the following error in my browser console:

DevTools failed to load source map: Could not parse content for https://cdn.apple-cloudkit.com/ck/2/resources/cloudkit.js.map: Unexpected token '<', "<!DOCTYPE "... is not valid JSON.  

I'm sure this is prob some simple thing that I am overlooking. I've searched through my code. Used ChatGPT as a tool to help me troubleshoot (actually what recommended I post here). Searched Stack Overflow.

Can anyone help me troubleshoot this issue? Any suggestions would be greatly appreciated. Thanks!

You can safely ignore this console error. There is no source map available for CloudKit JS.

Is your question related to the sign in logic for CloudKit JS or are you trying to implement Sign in with Apple? If it's about CloudKit JS, we'd need more information to help diagnose the issue. If it's about Sign in with Apple, that would be unrelated to CloudKit JS.

So then the issue with my button is code related? When I press the button nothing happens. It doesnt load the sign in page or anything. Like a dead button.

Sorry should have replied here... not comment...I tried changing the environment to 'production' but the button still isnt working. do you need any other code?

Here is my js code

//* CONFIGURING CLOUDKIT & ICLOUD USER AUTHENTICATION
CloudKit.configure ({
  containers: [{
    containerId: process.env.ICLOUD_CONTAINER,
    apiTokenAuth: {
        apiToken: process.env.ICLOUD_API_KEY,
        persist: true, // keeps user signed in after closing/reopening browser
        useAuth: true
    },
    environment: 'development' // or 'production'
  }]
});

// Logging process.env values
function main() {
  console.log(process.env.ICLOUD_CONTAINER);
  console.log(process.env.ICLOUD_API_KEY);
  console.log(process.env.ICLOUD_REDIRECT_URI);
  }
  document.addEventListener("DOMContentLoaded", main); 
  
CloudKit.on('error', (error) => {
  console.error(error);
});

CloudKit.getAuthStatus().then(function(response) {
  if(response.status === 'AUTHORIZED') {
    console.log('User is already signed in');
    landingPage.classList.add("hide");
    flashCardPage.classList.remove("hide");
    fetchAlbums();
  } else {
    console.log('User is not signed in');
    signInBtn.addEventListener("click", () => {
      CloudKit.signIn({
        scope: 'email',
        redirectURI: process.env.ICLOUD_REDIRECT_URI
      }).then((response) => {
        console.log(response);
        if(response.isSuccess) {
          landingPage.classList.add("hide");
          flashCardPage.classList.remove("hide");
          userIdentity = response.userIdentity;
          fetchAlbums();
        } else {
          console.error('Error signing in:', response.error);
        };
      });
    });
  };
});
"Apple Sign-in button not working on Heroku web app: troubleshooting help needed"
 
 
Q