Unknown Error of using 'watchify' npm package
I used the codeand 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 file19 Replies
anyone please :(
gotta be patient, people will answer when they can
also, calling attention to your thread is against the rules
ik, but i have less time to finish my project, i had no choice
sry
best bet I have is deleting node_modules and running
npm install
. Make a backup of node_modules if you don't trust just straight up deleting it, or you changed anything in there (which you shouldn't do)i installed only one package lol
*two
I have no other advice to give you, so good luck then
ok
I did what you said, but it returns the same err
what the heck is even
util.js
, and why doesn't the npm add itLast time yt-search was updated was 2 years ago according to the github
And it looks like the issue is that your yt-search package is calling some file
util.js
I did a quick search and didn't find much; their github has 1 closed issue from 2 years ago. My recommendation is making a youtube video parser from scratch
I'd be really surprised if youtube didn't have some public api for this
https://developers.google.com/youtube/v3/docs/videos
You could also probably just use any package or the default http/https api from node to get youtube videos PROBABLY
I'd have to see what exactly videoList
returns, but that or looking at the youtube api link I sent would probably be a decent start
So I just tested the axios method, it only returns the html, so yea you'd have to go with the youtube api method unless you want to manually parse the html for each linki copy pasted the code from github for the
util.js
, which fixed that error, but new errors are popping up :(Just remove the package and make your own at this point it seems unmaintained
f-, watchify returns an error which is hard to resolve
is the error
And I think that this here is your problem: you're copying code from github without knowing what it does or how it works.
Not sure if you've heard of the "X/Y Problem" but this smells of it. You're so hyper-focused on fixing what you don't understand that you're not asking the right questions. You came here to fix a specific error from a random github repo that hasn't been updated in years.
Instead, you should read #How To Ask Good Questions and ask the question you're trying to accomplish. Don't ask, "how do I fix this error?" Ask, "I'm trying to do [thing], and have tried [approach] and [other approach] and it's not doing [what I want]. Help?"
I've removed it, and a new error came related to watchify, and idfk how I can fix it. I can understand what the error is
btw watchify is also an npm package
but now I get an error which's from watchify (browserify) saying that
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
i wanna make a search mechanism where the results show when you search for a track in the search input
so i used browserify
npm package to convert node.js code into browser understandable code
instead of doing what i expected, it keeps on returning the same error
I googled almost like 50-60 times but can't get a clear answer
everyone posted the solution that suits their code
and not my code
im using yt-search and ytdl-core for thisa single google search lead me to this
https://github.com/mattdesl/esmify
GitHub
GitHub - mattdesl/esmify: parse and handle import/export for browse...
parse and handle import/export for browserify. Contribute to mattdesl/esmify development by creating an account on GitHub.
huh?
what did u search
literally the error
bruh
i searched it..
wait dumb me, i use brave search instead of google
also should we install esmify package?
the readme tells you what to do
I've never used it nor have I used browserify so I wouldn't know
first, i need to go eat and come
so that i can focus clearly
thanks for the help bro!
still that returns a new error
SyntaxError: D:\Visual Studio Code\IT exhibition\node_modules\htmlparser2\lib\esm\index.js: Export namespace should be first transformed by
@babel/plugin-proposal-export-namespace-from.