Open cwu-ms opened 1 year ago
To use any node module in a browser, it should be bundled by a working node module bundler. In node, require
is always present in CJS modules. I'm really unsure where this error could be coming from, and I think you'll need to provide more info.
@ljharb What other info would be helpful?
@cwu-ms are you using a bundler? What test runner/framework are you using? Is this error occurring in a browser or in node? which node version?
We are using Jest, and the error is appearing in node when we run npm run test
, for jest --config ./test-config/jest.config.js --verbose
. As for a bundler, we are using webpack.
Presumably webpack isn’t involved for the jest tests, though - can you share your jest config?
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme. Before submitting, please read over our commonly reported issues to prevent duplicates!
All common issues
Notoriously common issues
If you haven't found any duplicated issues, please report it with your environment!
Current behavior
When testing my project, I get this error with the mount() function:
Expected behavior
This test was running before, but after running
yarn install
, some of our other dependencies were updated and now the mount() function is throwing errors. We're not sure why this might be happening, since the relation between these updates and the new error is not clear. Does anyone know why this is happening?Your environment
API
Version
Adapter