What's wrong with my audio source?

The sound “pickupSFX” does not play.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;


[RequireComponent(typeof(AudioSource))]

public class InventoryItem : MonoBehaviour
{
    public AudioClip pickupSFX;
    AudioSource audioSource;

    void Start()
    {
        audioSource = GetComponent<AudioSource>();
    }

    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.name == "Player")
        {
            audioSource.PlayOneShot(pickupSFX, 1.0f);

            gameObject.SetActive(false);
        }
    }

}

Components only work when they’re enabled and on an active GameObject. Since you disable your GameObject, the AudioSource stops working immediately.