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

162
Visualizações
javascript-obfuscator with pkg - require fails at runtime

Before obfuscation executable file is successful but after javascript-obfuscation it gives me the below warning and it cannot output exe file.

Warning Cannot resolve '_0xe96414(443)'C:\Users\pathtofile.js

Dynamic require may fail at run time, because the requested file is unknown at compilation time and not included into executable. Use a string literal as an argument for 'require', or leave it as is and specify the resolved file name in 'scripts' option.

I went through this document here but I don't know how can I add all the requires into pkg scripts. Please let me know how to add requires into pkg scripts or any other way to add requires to pkg so it will include require in the executable.

const path = require("path");

const root = require("../../util/root/root");

const serveReactBundle = (req, res, next) => {
  res.sendFile(path.join(root, "public", "build", "index.html"), err => { if (err) next(err) });
}

module.exports = serveReactBundle;

"pkg": {
    "assets": [
        "public/**/*",
        "jsonfiles/**/*"
    ],
    "targets": [
        "node14-win-x64"
    ],
    "private": "true",
    "scripts": "modules/**/*.js"
},

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

The waring was informing that the url path is changed so I made the require path as the original file

path=require(_0x1fb780(0x154)),root=require(_0x1fb780(0x156))

As the warning told Dynamic require may fail at run time, because the requested file is unknown at compilation time and not included into executable, so in the obfuscated file I changed it to the normal path(below snippet) as in warning (or leave it as is) apparently it wont take the obfuscated path.

path=require('path'),root=require('../../util/root/root')

about 4 years ago · Santiago Gelvez Relatório
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