Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Login to Discord.js using browserify

I'm trying to use discordjs in the js file linked to the homepage of my website.

I've first referred to the library in the head section, like this:

<script src="lib/discord.js/"></script>

But here I get the error "(index):1 Uncaught SyntaxError: Unexpected token '<' " as Chrome seems to be trying to use an html file which indicates what's in the lib/discord.js/ directory.

I tried to add the type="typescript" info into the tag but then I can't use the library anymore.

So I installed browserify to require library in a nodejs style, but once again got an error trying to create the bundle.js:

Error: Parsing file /Users/polochon/Desktop/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js: Unexpected token (384:18)
at Deps.parseDeps (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:519:15)
at getDeps (/usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:447:44)
at /usr/local/lib/node_modules/browserify/node_modules/module-deps/index.js:430:38
at ConcatStream.<anonymous> (/usr/local/lib/node_modules/browserify/node_modules/concat-stream/index.js:37:43)
at ConcatStream.emit (node:events:406:35)
at finishMaybe (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:630:14)
at endWritable (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at ConcatStream.Writable.end (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at DuplexWrapper.onend (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:513:28)

I'm new to web development and feel like I'm forgetting something basic, or maybe there's an easier way than to use browserify. I would appreciate any help :).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!