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

170
Visualizações
reactstrap typescript nx `Uncaught ReferenceError: global is not defined`

I'm using reactstrap@8.6.0 with nx and typescript. But if any component is included from reactstrap the app is crashing with below error

index.js:3 Uncaught ReferenceError: global is not defined
    at Object.../../../node_modules/has-symbols/index.js (index.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object.../../../node_modules/get-intrinsic/index.js (index.js:54)
    at __webpack_require__ (bootstrap:79)
    at Object.../../../node_modules/call-bind/callBound.js (callBound.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object.../../../node_modules/is-arguments/index.js (index.js:4)
    at __webpack_require__ (bootstrap:79)
    at Object.../../../node_modules/deep-equal/index.js (index.js:2)
    at __webpack_require__ (bootstrap:79)

As suggested here tried below configuration in jest.config.js but avail no luck.

module.exports = {
  name: 'cadence',
  preset: '../../jest.config.js',
  transform: {
    '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
    '^.+\\.[tj]sx?$': [
      'babel-jest',
      { cwd: __dirname, configFile: './babel-jest.config.json' },
    ],
  },
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
  coverageDirectory: '../../coverage/apps/cadence',
  setupFilesAfterEnv: ['./jest.setup.js'],
  target: 'node',
  node: { global: true },
};

Any help will be really appreciated.

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

0

I had a similar issue and solved by modifying webpack config - Add webpack.config.js to apps/your-react-app/webpack.config.js with:

const nrwlConfig = require('@nrwl/react/plugins/webpack.js');

module.exports = (config, context) => {
    nrwlConfig(config);

    return {
        ...config,
        node: {
            global: true,
        },
    };
};
about 4 years ago · Santiago Trujillo 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