React, Redux Tutorials Tests are not executing

React, Redux Tutorials Tests are not executing
0

Will need to see your full code for the challenge then.

This is code from challenge :https://www.freecodecamp.org/learn/front-end-libraries/react/create-a-simple-jsx-element
My full code : const JSX = <h1>Hello JSX!</h1>;
When i click button Run The Tests!
// running tests message comes and the error popus up in browser console and nothing happens.
Error is there for all react and redux challenges

It could be worth clearing your browser’s cache. So, for Chrome, please open the dev console (f12), click on the ‘Network’ tab and then make sure the ‘Disable cache’ box is ticked. Once you’ve done that, reload the page and try to run the tests again. You should see something like this:


in the Network tab.

If that doesn’t fix it (or even if it does) please let us know what happens.

@ojeytonwilliams I tried your suggestion and still not able to pass the tests with valid code.

@ojeytonwilliams
The suggestion is not working for me too.
I have tried in multiple computers, windows and mac os and is also facing issue in chrome and firefox browsers.

This seems like a caching issue. I noticed that our webpack config for the client/src/client (workers, frame-runner, etc) do not create a hashed binary. A recent PR seems to have updated the enzyme package. But webpack builds a non-hashed version '[name].js' instead of '[name].[hash].js'

Our CDN caching aggressively caches JavaScript and this is the root cause. As an immediate fix I have invalidated our cache, which means a perf hit to us.

But the real issue is we need to see why webpack is behaving like it is. Can someone please report a GitHub issue for tracebility and add it here in comments.

Thanks.

Just to add Gatsby’s webpack config is indeed generating the hashed binaries, its our internal webpack config using the webpack-cli wiring that is not playing well.

Since we are on Cloudflare we are able to aggressively cache all JavaScript for fast load times but we need them to be hashed for invalidation. Now, as seen since some of the JS binaries do not have the hash, its most likely breaking the UX.

Anyways the manual invalidation from my end on the CDN should have fixed this for now, but we want to fix the config to avoid doing that again.

Tell us what’s happening:

Your code so far


const ChildComponent = () => {
return (
  <div>
    <p>I am the child</p>
  </div>
);
};

class ParentComponent extends React.Component {
constructor(props) {
  super(props);
}
render() {
  return (
    <div>
      <h1>I am the parent</h1>
      { /* change code below this line */ }
        <ChildComponent/>
       

      { /* change code above this line */ }
    </div>
  );
}
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36.

Challenge: Create a Component with Composition

Link to the challenge:
https://www.freecodecamp.org/learn/front-end-libraries/react/create-a-component-with-composition

Are you receiving any error messages?

Nope never received any errors. Checking the console in chrome though brings up an error…

Uncaught (in promise) TypeError: Cannot read property 'call' of undefined
    at o (VM250 frame-runner.js:1)
    at Object.<anonymous> (VM256 vendors~enzyme~enzyme-adapter.js:8)
    at Object.<anonymous> (VM256 vendors~enzyme~enzyme-adapter.js:8)
    at o (VM250 frame-runner.js:1)
    at Object.<anonymous> (VM256 vendors~enzyme~enzyme-adapter.js:8)
    at o (VM250 frame-runner.js:1)
    at Object.<anonymous> (VM256 vendors~enzyme~enzyme-adapter.js:8)
    at o (VM250 frame-runner.js:1)
    at Object.<anonymous> (VM256 vendors~enzyme~enzyme-adapter.js:8)
    at o (VM250 frame-runner.js:1)` 

I’ve just copied your code and it passed.

If I click on “run test” it doesn’t complete. It is really weird.

I am having the same issue in the React section. “Run the test” button is not working…

I copied your code and it passed. Maybe it’s a bug specific to your browser/OS?

I do get this in the console everytime I run the tests:
act(...) is not supported in production builds of React, and might not behave as expected.

@Ne0nWinds What browser and version are you using?

Firefox 70 on Ubuntu

Hey @HystericalMisfit do you confirm you’re using Google Chrome? What’s the operational system?

I am using chrome on windows 10, I have also tried on 2 other PCs and the same problem. but it is only in the React section.

1 Like

We have just invalidated our CDN cache to fix this, can you all please try and check again? Here is a thread if you want to learn more:

Hi, I have just checked and it still is not working. I have tried the next tutorial as well and the same result.