Adding CDN FCC Test to React App

Hello,

I know there’s several threads talking about how to get the CDN to work for testing your project. However, I can’t seem to get them to work with the given solutions.

I’ve put the script tag at the beginning of the body, at the end of the body, in the <div> tag which has the id="app". Put it in the head… Everywhere! I can’t seem to get it to show up.

Attached a link so that you could see what I currently have.

Thanks!

You have to put it as a < script src=“https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js” defer> < /script> in the head not in the body

I tried this as well before, it doesn’t pop up when I do :frowning:

It’s quite strange, I just tested your code in my index.html and the test works. I attach a screenshot

Screenshot 2023-09-11 at 23-44-50 Markdown Previewer

Well now that’s just very odd… what the heck.
I wonder if it’s a stackblitz issue.

Try doing it with Visual Studio Code

I might have to, been a couple hours messing around with Stackblitz on trying dozens of solutions posted in the forums. Dang it!

Use the Vite template.

Add the test script in the body element at the bottom.


The test script doesn’t work with the template that is using create-react-app.

Also, the npm package you installed does the exact same thing. It is using react-helmet to add the script to the head element. Which again doesn’t work with the template you are using.

1 Like

Thanks! I’ll try this one again.
One of the solutions pointed me towards this template, I believe she said you’d made it.

But anyhoot, I must’ve had a referencing error or something when I tried to copy my code over to it, because it wouldn’t work for me on there either.
One day I might not be such a n00b.

If you post a link to it maybe we can help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.