Unknown Error of using 'watchify' npm package

I used the code
const ytdl = require('ytdl-core');
const search = require('yt-search');
const { getInfo, play, showInfo } = require('./helper.js');

// Get HTML elements
const searchResult = document.getElementsByClassName('result');
const searchInput = document.getElementById('searchInput');

// Do all the functions
searchInput.addEventListener('keyup', async (ev) => {
  let results = await getInfo(searchInput);
  
  await showInfo(results);
});
and got this error in the browser console (see the img)

I'm using watchify npm package to convert it to something that browser understands. and I got this error when I used this code. idk why this error came. I even put "type": "module", in the package.json file and put type="module" in the <script> tag in the html file
image.png
Was this page helpful?