http://beta.freecodecamp.com/en/challenges/managing-packages-with-npm/using-packagejson-the-core-of-any-nodejs-project-or-npm-package and remaining challenges in section
@Greenheart @Em-Ant Ok, so I've located the boilerplate GoMix project that is needed for these challenges, however I see 3 issues:
Here's my current project: https://gomix.com/#!/project/lopsided-leader (might be changed by the time you read this, but see screenshot)
For the first challenge my code looks like this:
But no dice on getting test to pass. The embedded console just shows a pair of double quotes.
Ok, so a bit more on this. The boilerplate project does pass the first few tests since "author" and "description" are already present...
BUT, as soon as the project is "remixed", even if nothing else is changed at all, the tests fail. This doesn't make any sense at all to me since there does not appear to be anything in the tests that should be specific to the boilerplate project, so hopefully someone with more backend knowledge can jump in and figure this out.
But as it stands now, none of these challenges work unfortunately (I haven't tested every single one, but a good handful with the same results).
Also, I think the placeholder text should be something like https://your-app-here.gomix.me
so it's more clear which of the 2 urls you need (editor url or "live" url).
It looks like this has to do with the CORS setting in the boilerplate, I recommend changing in the server.js to this:
var allowedOrigins = ['https://marsh-glazer.hyperdev.space', 'http://beta.freecodecamp.com'];
Edit: This was tested on a Remix as well (but still needed to change the CORS of course)
Edit 2: All boilerplates should probably have the beta FCC and normal FCC url in them, @Em-Ant
@JosephLivengood Nice! I just updated it to that in my project and it is now working ✋ <- high five
Although, it is working with or without the trailing /
@JosephLivengood all the boilerplates have CORS enabled for all origins at this stage (if I remember correctly ).
If process.env.XORIG_ALL
is set in the .env file to allow for such, its value is not carried over in the remixing of the project making it not allow anything except the explicitly defined 2 in the server.js Im seeing (at least on _red-moose_) ['https://marsh-glazer.hyperdev.space', 'https://www.freecodecamp.com'];
which isn't allowing non secure http requests which I see most people using for the beta
@JosephLivengood You should use the boilerplates listed here https://hackmd.io/GYVgTBIIxgtAzATgCYCNYBYCGZ2oBwbqLCJSKIj4DG1y8QA=
they are owned by the camperbot github account. In these projects i changed the logic, from XORIG_ALL to XORIG_RESTRICT, that restrict CORS only if set.
@Em-Ant Oh looks like we had a out dated one, Thanks!! 👍
Having issues with the first challenge. It seems like getting the package.json file is failing on my Chrome browser (Mac). Any can confirm or could point me in the right direction to complete the first Author challenge?
@Ethan-Arrowood can you add some details about your problem ? Have you tried with another browser ? I'm testing the challenge now and it's working fine or me. Sometimes Gomix can have a strange behaviour...
@Em-Ant I'm using Chrome and tried it on Safari but no such luck.
I've tried to following links:
https://gomix.com/#!/join/32c0bf28-9ac9-496c-8cc9-960ccef49616
The result from each:
Even though I clearly have the author field defined in my package.json file:
Ok. There is no problem with your browser.
You need to remix (fork) a preconfigured project provided by us, for each of the back-end exercises section. The one for this challenge is https://gomix.com/#!/project/storm-leopard. Then you have to edit your new project's package.json. You have to use the Show Live URL in the FCC page, so the url to submit should look like the element 3 of your list (i.e. no # in the url)
You can find the complete list of boilerplates in this document
Sorry. We need to add the link to the project to remix, and explain better the procedure in the challenge description.
Hope this helps.
There we go! Okay great now I can work on getting the completed box to show up after passing the test 👍
Hi, I'm having issues with this as well. I don't know if it broke again as another side effect of #14015, but when I attempt to submit for the How to Use package.json challenge (using https://fcc-backend.glitch.me, which I cloned from the https://gomix.com/#!/project/storm-leopard project linked above), I get the "" error and 'package.json should have a valid "author" key' message.
I also get this in my browser console:
Refused to connect to 'https://fcc-backend.glitch.me/_api/package.json' because it violates the following Content Security Policy directive: "connect-src 'self' https://gomix.com https://.gomix.com https://.gomix.me https://*.cloudflare.com".
I'm using the latest version of Chrome and macOS 10.12.3 (desktop).
We need to update the content security policy settings to include the new glitch links. Sorry.
cc @BerkeleyTrue
Seeing things
I'm having issues with the entire "Apis And Microservices" section as well, can't get any challenge to pass even though they are correct. Doesn't matter if I use Firefox or Chrome.
Nothing is working for me too.
Although I've successfully done the challenges, when I paste the link and click on "I've completed the challenge", nothing happens.
It just says : // running test
I've went on that link : FCC Back-end Tester and when I paste my link and click on the tests, all is working fine. So I assume there is something wrong on the beta website.
Still broken. Entire section. Even when trying @Em-Ant 's workaround.
@knight2 I'm sorry.
I worked only on the glitch (former gomix) projects, I don't know exactly at what point the integration in the beta site is. I haven't worked on this since February, because FCC helped me to get my first, then second programming job, I had to move, and basically I was too busy. Maybe @Greenheart has more infos ?
It seems as though this type of tests are currently not being run for any of the back-end exercises after a breaking change at some point.
Are the back-end challenges using the same testing logic as the "regular" JavaScript exercise? The reason I'm asking is because the seed data ([challenge].test.testString
) suggests that an XHR should be made at some point (using jQuery.get()
(only the relevant part is shown):
"tests": [
{
"text": "package.json should have a valid \"author\" key",
"testString": "getUserInput => $.get(getUserInput('url') + '/_api/package.json').then(data => { var packJson = JSON.parse(data); assert(packJson.author, '\"author\" is missing'); }, xhr => { throw new Error(xhr.responseText); })"
}
]
but absolutely nothing happens under the Network panel of dev tools when the "I've completed this challenge (ctrl + enter)" button is pressed.
If the assumption that the back-end challenges are tested using (mostly) the same logic as the regular JavaScript challenges is correct, then I assume line 75 (eval(testString)
) of freeCodeCamp/client/frame-runner.js is used to convert the string into code. Using console.log()
, I found that frame-runner.js is never invoked for the few back-end challenges I sampled.
A potentially related issue is that a TypeError is triggered if you visit any of the back-end challenges. Whatever causes this error, it appears to be something that the is shared between all other challenges (I'm thinking the Redux store) because it does not get triggered until the page is refreshed. In addition, whatever causing this error is also affecting the regular JavaScript challenges because once the error is triggered, // Happy Coding!
, instead of actual code, will appear in the code editors for the regular JavaScript challenges (again, until you refresh the page).
I found it rather difficult to figure out how the rest of it is hooked up, partly because I have trouble following the logic using an event listener with global variables, so I haven't dived further into the rabbit hole, but I hope this helps. :)
Edit: I think the glitch template still requires changes to Access-Control-Allow-Origin
.
P.S. Just out of curiosity, what is the reason behind using an event listener like this? This is not a criticism, not least because I'm inexperienced, but I personally would have gone straight for fetch
and redux thunk
.
I started the Managing Packages with npm from the first challenge. I used this https://glitch.com/edit/#!/alabaster-click to change the code on Glitch and then passed the Glitch URL back to fCC test but the program throws this error:
Most of the time when I submitted my Glitch app link on fCC, there's just nothing changed on the UI (the tests are not ran and nothing responses). The TypeError error is only thrown when I refreshed and tried submitting the links a couple of times
I'm going to spend some time tonight looking at reproducing this problem. If I can successfully get that far, I will claim this issue.
@honmanyau correct ! The tests should do an ajax call to the project background express app. The CORS headers should be edited in order to include beta.freecodecamp.org, but even if you do it manually on your project, it seems that no request is received from freecodecamp.
Most helpful comment
Ok. There is no problem with your browser.
You need to remix (fork) a preconfigured project provided by us, for each of the back-end exercises section. The one for this challenge is https://gomix.com/#!/project/storm-leopard. Then you have to edit your new project's package.json. You have to use the Show Live URL in the FCC page, so the url to submit should look like the element 3 of your list (i.e. no # in the url)
You can find the complete list of boilerplates in this document
Sorry. We need to add the link to the project to remix, and explain better the procedure in the challenge description.
Hope this helps.