Build a Recipe Tracker - Step 6

Tell us what’s happening:

I can’t pass Step 6. The console states:

  1. You should remove the recipe1Name variable.
  2. You should remove the recipe2Name variable.
  3. You should remove the recipe1CookingTime variable.
  4. You should remove the recipe2CookingTime variable.

I have deleted them and tried the various steps in other, similar, posts.
many thanks
Davie.x

Your code so far

const recipes = [];

const recipe1 = {
  name: 'Spaghetti Carbonara',
  ingredients: ['spaghetti', 'Parmesan cheese', 'pancetta', 'black pepper'],
  cookingTime: 22,
  totalIngredients: null,
  difficultyLevel: '',
  ratings: [4, 5, 4, 5],
  averageRating: null,
};

const recipe2 = {
  name: 'Chicken Curry',
  ingredients: ['chicken breast', 'coconut milk', 'curry powder', 'onion', 'garlic'],
  cookingTime: 42,
  totalIngredients: null,
  difficultyLevel: '',
  ratings: [4, 5, 5, 5],
  averageRating: null,
};

const recipe3 = {
  name: 'Vegetable Stir Fry',
  ingredients: ['broccoli', 'carrot', 'bell pepper'],
  cookingTime: 15,
  totalIngredients: null,
  difficultyLevel: '',
  ratings: [4, 3, 4, 5],
  averageRating: null,
};


// User Editable Region

recipes.push(recipe1);
recipes.push(recipe2);
recipes.push(recipe3);


// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15

Challenge Information:

Build a Recipe Tracker - Step 6

Yeah, your code is good. Try resetting the step, and/or check browser’s console, maybe there’s something more in it.

yeah, I tried the steps on another post. I can only see it as am issue with the platform.x

Your solution works from my end. Please try one of the following steps to move forward.

Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.

or - Try the step in incognito or private mode.

or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.

or - Ensure your browser is up-to-date or try a different browser.

I hope one of these will work for you.

I’ve tried all those options, though, ctrl + f5, doesn’t refresh on a Mac. I installed DuckDuckGo but that didn’t work either.
Having to carry out those steps, any steps, really, would suggest there’s an issue in the console. It must still be reading the deleted items, no?x

Your code works for me as well and I have a Mac. Ctrl F5 on a mac is Cmd+Shift+R. Try refreshing, also in case there are any errors slipped into the existing code.

yeah, I know, I did try that :joy:. I’ve tolled through the code, looking for anything, clutching at straws, really. Even tried to get it on my phone but for some reason it creates a new account instead of logging me in. That’ll be another post :joy:x

managed to log in on my phone, same issue there.x

@a1legalfreelance What browser are you using?

@Davie_Smith Try Chrome or Firefox. DuckDuckGo uses WebKit on iOS and macOS and that is the same as Safari.


When I check the variables tests in WebKit it seems like the expected error message isn’t correct.

try {
  recipe1Name;
  console.log('Variable is defined/declared');
} catch (e) {
  console.log(e?.message, 'recipe1Name is not defined');
}
[Log] Can't find variable: recipe1Name – "recipe1Name is not defined"

So the assert.include might be failing on WebKit based browser (maybe?).

Tests: freeCodeCamp/curriculum/challenges/english/25-front-end-development/workshop-recipe-tracker/66fbcf750a62784cf11f5630.md at main · freeCodeCamp/freeCodeCamp · GitHub

try {
  recipe1Name;
  assert.fail('Variable is defined/declared');
} catch (e) {
  assert.include(e?.message, 'recipe1Name is not defined');
}

I can only test it using playwright with WebKit. So if anyone on Mac can confirm this works on Chrome/Firefox but not Safari, that would be great.

Edit: Don’t know why I didn’t do this already, but I just tested the actual challenge in WebKit and the passing code that is posted don’t pass for me with WebKit. So I assume it is in fact an issue with WebKit. But I would like to get confirmation from someone using a Mac.

@lasjorg I’m using Chrome. I also tried it on Firefox and it passes there as well.

@a1legalfreelance Thank you.

Just so I’m sure, can you confirm it is failing for you using Safari?

Just tried Safari and it won’t pass for me. I’m using a mac.

1 Like

@jwilkins.oboe Thank you for the confirmation.

I opened an issue for it.

1 Like

@lasjorg No it didn’t pass for me on Safari. The failure tests were the same as for the OP.

Thanks @lasjorg and everyone. We knew it worked on Chrome but don’t want to install that. I’ll think about Firefox, though may just move on, see if it gets fixed.
Thanks again, for all the replies and suggestions.
Davie.x

Hey, my head and body part won’t work can i have a tip on achieving this?

please create your own topic to ask your question

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

The issue appears to be fixed. I finally got the code to pass. Well played fCC, you are the best :smiling_face_with_three_hearts:x