Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda