question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests failing with the message ReferenceError: require is not defined

See original GitHub issue

After 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

image

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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sandroococommented, Nov 1, 2022

Sorry for the late reply, it also works for us now. Thanks for your effort @wynfred.

0reactions
Predrag09commented, Oct 28, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found