Tests failing with the message ReferenceError: require is not defined
See original GitHub issueAfter successful update of the library to latest version 14.0.0
tests were failing in couple of components that rely on this library.
When running ng test
we get the following error:
Message is ReferenceError: require is not defined
Here is the link to Stack Overflow question with full description of a problem: https://stackoverflow.com/questions/74179462/tests-failing-after-updating-from-13-0-0-to-latest-14-0-0-version-of-ngx-masonry
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Client on Node.js: Uncaught ReferenceError: require is not ...
throws the Uncaught ReferenceError: require is not defined. I was able to work around that by specifying Node.js integration as true when the...
Read more >ReferenceError: require is not defined #33741 - nodejs/node
console.log(require); Run //node-v12.18.0-linux-x64/bin/node test.js; Node returns error output stating that require is not defined.
Read more >referenceerror: require is not defined jest - You.com
Finally found the solution, renaming my jest.config.js file to jest.config.cfs, fixed the issue. Please find the explanation in this stackoverflow thread. Open ...
Read more >Configuring Jest
Jest will run .mjs and .js files with nearest package.json 's type field set to module as ECMAScript Modules.
Read more >How to fix "require is not defined" in JavaScript / Node.js?
You are getting the “ReferenceError: require is not defined” error in the browser environment because the require() method is supported in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the late reply, it also works for us now. Thanks for your effort @wynfred.
Great, now it works in our project! App compiles successfully and tests are passing without any warnings or errors. How about @sandrooco? Have you tried updating?