Skip to content

Commit

Permalink
Ignore relative requires
Browse files Browse the repository at this point in the history
  • Loading branch information
rauenzi committed Dec 15, 2023
1 parent cff2aa2 commit a47c0a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions renderer/src/polyfill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ originalFs.writeFile = (path, data, options) => fs.writeFile(path, data, Object.

export const createRequire = function (path) {
return mod => {
// Ignore relative require attempts because Discord
// erroneously does this a lot apparently which
// causes us to do filesystem accesses in our default
// switch statement mainly used for absolute paths
if (typeof(mod) === "string" && mod.startsWith("./")) return;

if (deprecated.has(mod)) {
Logger.warn("Remote~Require", `The "${mod}" module is marked as deprecated. ${deprecated.get(mod)}`);
}
Expand Down

0 comments on commit a47c0a0

Please sign in to comment.