Function is unable to find dependency

I have tried every stitch of documentation I could find on this issue, and the resolution still evades me. I’m trying to write a simple function that verifies user login information based on an existing collection.

  1. I have added the dependency with the “Add Dependency” button
  2. I have uploaded the node_modules folder.
  3. I have pulled the app with the cli, installed the dependency and pushed it up that way.

In all instances you can see the dependency on the dependency tab, but the function refuses to find it. I just keep getting this error:

failed to execute source for 'node_modules/argon2/argon2.js': TypeError: Value is not an object: undefined
	at node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js:29:18(4)
	at node_modules/argon2/argon2.js:34:30(93)

super simple function that is trying to use it, with sensitive information removed of course:

exports = async (loginPayload) => {
    const argon2 = require('argon2');
    
    let response;

    
  const user = await context.services.get("mongodb-atlas").db("database").collection("collection").find({email: loginPayload.email}).toArray();
  
  
  if(!user) {
    response = {
      message: 'User not found',
      status: 400
    }
    
    return JSON.stringify(response);
  } 
  
  const verify = await argon2.verify(loginPayload.password, user.password);
  if(!verify) {
    response = {
      message: "Invalid username or password",
      status: 400
    }
    
    return JSON.stringify(response);
  }
  
  
  return {message: 'authenticated', user: JSON.stringify(user)};
  };

I could really use some good juju here if anyone has any… that is of course actually working.