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

255
Views
Uncaught TypeError: Cannot read properties of undefined (reading 'call') - webpack.require

Can anyone please help me in resolving this issue?

Error image

Webpack.config.js :

module.exports = {
  devtool: isProdEnv ? "source-map" : "eval",
  entry: "./lib/index.ts",
  mode: isProdEnv ? "production" : "development",
  watch: isWatchEnv,
  target: "node",
  externals: [
    nodeExternals({
      allowlist: ["node-fetch"],
    }),
  ],
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: ["ts-loader"],
        exclude: /node_modules/,
      },
    ],
  },
  resolve: {
    extensions: [".tsx", ".ts", ".js"],
    fallback: {
      buffer: require.resolve("buffer"),
      stream: require.resolve("stream-browserify"),
    },
  },
  output: {
    filename: path.basename(pkg.main),
    path: path.resolve(cwd, "dist"),
    libraryTarget: "commonjs2",
  },
  plugins,
  optimization: {
    usedExports: true, // TODO: how to enable tree shaking on commonjs internal and modules? tsconfig should be esnext?
  },
};

tsconfig.json:

"compilerOptions": { "module": "commonjs", "declaration": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "noImplicitAny": true, "noImplicitThis": true, "noUnusedLocals": true, "target": "es5", "sourceMap": true, "moduleResolution": "node", "resolveJsonModule": true, "skipLibCheck": true, "lib": ["es2017", "es7", "es6", "dom", "es2015"], "baseUrl": "./packages" },

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!