При загрузке аудиофайла в профиле в модальном окне профиля пользователя ничего не происходит. Я жму “upload track” и ничего не происходит. База данных tracks не пополняется, папка с треками тоже пустая, как и картинки для альбома не загружаются. проанализируй код, в первую очередь app.js, исправь проблему. Также в консоли я получаю ошибку:

TypeError: Cannot read properties of null (reading 'addEventListener')

код:
  <body>
    <div class="container">
      <div class="row">
        <div class="col-md-3">
          <img src="/img/<%= musician.thumbnail || 'avatar.jpg' %>" alt="<%= musician.name %>" width="200" height="200">
        </div>
        <div class="col-md-8">
          <h1><%= musician.name %></h1>
          <p><strong>Role:</strong> <%= musician.role %></p>
          <p><strong>Genre:</strong> <%= musician.genre %></p>
          <% if (musician.role === 'Artist' && musician.instrument) { %>
            <p><strong>Instrument:</strong> <%= musician.instrument %></p>
          <% } %>
          <p><strong>Location:</strong> <%= musician.city %></p>
          <p><strong>Bio:</strong> <%= musician.bio %></p>
		  <!-- users' music -->
		  <h3>Tracks:</h3>
    <ul>
        <% tracks.forEach(track => { %>
            <li>
                <%= track.title %> (<%= track.album_title || "No Album" %>)
                <audio controls>
                    <source src="/tracks/<%= track.filename %>" type="audio/mpeg">
                </audio>
                <img src="/img/<%= track.image_filename || 'default-track-image.jpg' %>" alt="<%= track.title %>" width="200" height="200">
            </li>
        <% }); %>
    </ul>
          <% if (musician.soundcloud) { %>
            <div class="embed-responsive embed-responsive-16by9">
              <iframe class="embed-responsive-item" src="https://w.soundcloud.com/player/?url=<%= musician.soundcloud %>&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
            </div>
          <% } %>
          <% if (musician.soundcloud1) { %>
            <div class="embed-responsive embed-responsive-16by9">
              <iframe class="embed-responsive-item" src="https://w.soundcloud.com/player/?url=<%= musician.soundcloud1 %>&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
            </div>
			
          <% } %>
          <% if (userLoggedIn && username === musician.name) { %>
            <button type="button" class="btn btn-primary mt-3 mb-3" data-toggle="modal" data-target="#edit-profile-modal">Edit Profile</button>
            <div id="edit-profile-modal" class="modal fade">
              <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                  <div class="modal-header">
                    <h4 class="modal-title">Edit Profile</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                  </div>
                  <div class="modal-body">
                    <form action="/profile/<%= musician.id %>/edit" method="POST" enctype="multipart/form-data">
                      <div class="form-group">
                        <label for="name">Name:</label>
                        <input type="text" id="name" name="name" value="<%= musician.name %>" class="form-control">
                      </div>
                      <div class="form-group">
                        <label for="role">Role:</label>
                        <select id="role" name="role" class="form-control">
                          <option value="">Select a role</option>
                          <option value="Band" <%= musician.role === 'Band' ? 'selected' : '' %>>Band</option>
                          <option value="Artist" <%= musician.role === 'Artist' ? 'selected' : '' %>>Artist</option>
                        </select>
                      </div>
                      <div class="form-group">
                        <label for="genre">Genre:</label>
                        <select id="genre" name="genre" class="form-control">
                          <option value="">Select a genre</option>
                          <option value="Rock" <%= musician.genre === 'Rock' ? 'selected' : '' %>>Rock</option>
                         <option value="Pop" <%= musician.genre === 'Pop' ? 'selected' : '' %>>Pop</option>
                          <option value="Hip-hop" <%= musician.genre === 'Hip-hop' ? 'selected' : '' %>>Hip-hop</option>
                          <option value="Jazz" <%= musician.genre === 'Jazz' ? 'selected' : '' %>>Jazz</option>
                          <option value="Electronic" <%= musician.genre === 'Electronic' ? 'selected' : '' %>>Electronic</option>
                          <option value="Classical" <%= musician.genre === 'Classical' ? 'selected' : '' %>>Classical</option>
                        </select>
                      </div>
                      <% if (musician.role === 'Artist') { %>
                        <div class="form-group">
                          <label for="instrument">Instrument:</label>
                          <input type="text" id="instrument" name="instrument" value="<%= musician.instrument || '' %>" class="form-control">
                        </div>
                      <% } %>
                      <div class="form-group">
                        <label for="city">Location:</label>
                        <input id="city" name="city" type="text" autocomplete="on" value="<%= city %>" data-value="" class="form-control">
                      </div>
                      <div class="form-group">
                        <label for="bio">Bio:</label>
                        <textarea id="bio" name="bio" class="form-control"><%= musician.bio %></textarea>
                      </div>
                      <div class="form-group">
                        <label for="thumbnail">Thumbnail:</label>
                        <input type="file" id="thumbnail" name="thumbnail" accept="image/*" class="form-control-file">
                      </div>
					  <!-- загрузка музла -->
					  
    
<div>
    <h2>Upload a new track:</h2>
    <form id="upload-form" enctype="multipart/form-data" onsubmit="submitForm(event)">
        <div class="form-group">
            <label for="track">Track file:</label>
            <input type="file" id="track" name="track" accept="audio/" class="form-control-file" required>
        </div>
        <div class="form-group">
            <label for="title">Track title:</label>
            <input type="text" id="title" name="title" class="form-control" required>
        </div>
        <div class="form-group">
            <label for="albumTitle">Album title:</label>
            <input type="text" id="albumTitle" name="albumTitle" class="form-control">
        </div>
        <div class="form-group">
            <label for="image">Track image:</label>
            <input type="file" id="image" name="image" accept="image/" class="form-control-file">
        </div>
        <button type="submit" class="btn btn-primary">Upload Track</button>
    </form>
	<script>
  function submitForm(event) {
    event.preventDefault();
    const form = document.getElementById("upload-form");
    const formData = new FormData(form);
    
    fetch("/profile/<%= musician.id %>/upload", {
      method: "POST",
      body: formData,
    })
      .then((response) => {
        if (response.ok) {
          // если запрос прошел успешно - обновляем страницу
          location.reload();
        } else {
          // если что-то пошло не так - выводим сообщение об ошибке
          alert("Error uploading track");
        }
      })
      .catch((error) => {
        console.error("Error:", error);
        alert("Error uploading track");
      });
  }

  // Заменяем элемент формы с кнопкой "submit" на обработчик события "submit"
  document
    .getElementById("upload-form")
    .addEventListener("submit", submitForm);
</script>