Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

246
Vistas
TypeError: Cannot read property 'tap' of undefined when adding webpack-subresource-integrity

I'm trying to configure the webpack-subresource-integrity package on my config-overrides.js(react-app-rewired):

const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity');

module.exports = function override(config, env) {
  config.optimization.splitChunks.cacheGroups = {
    ...config.optimization.splitChunks.cacheGroups,
    project: {
      test: /[\\/]node_modules[\\/]@project[\\/]/
    }
  };

  // added this part
  config.output = {
    crossOriginLoading: 'anonymous'
  };

  config.plugins = [...config.plugins, new SubresourceIntegrityPlugin()];


  return config;
};

I get TypeError: Cannot read property 'tap' of undefined

I already tried to delete my node_modules, yarn.lock and then re-install the packages but I still get the same error.

This is the full error:

/Users/me/myProject/node_modules/react-scripts/scripts/start.js:19
  throw err;
  ^

TypeError: Cannot read property 'tap' of undefined
    at /Users/me/myProject/node_modules/webpack-subresource-integrity/index.js:235:48
    at SyncHook.eval [as call] (eval at create (/Users/me/myProject/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:89:1)
    at SyncHook.lazyCompileHook (/Users/me/myProject/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.newCompilation (/Users/me/myProject/node_modules/webpack/lib/Compiler.js:631:26)
    at /Users/me/myProject/node_modules/webpack/lib/Compiler.js:667:29
    at _next0 (eval at create (/Users/me/myProject/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/Users/me/myProject/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:26:1)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I have solution for that will be working fine please follow the below step :

  1. remove the node_modules folder from project directory
  2. remove the package-lock.json file
  3. make sure clear the cache use this command npm cache clean --force
  4. afterward verify the bytes of memory using this command npm cache verify
  5. and then do again use npm install
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda