Create Strings using Template Literals - Invalid regular expression flags

Tell us what’s happening:

I am getting “Invalid regular expression flags” error. The “Template strings were used” requirement is not passing. Anyone know what I’m doing wrong?

Your code so far


const result = {
  success: ["max-length", "no-amd", "prefer-arrow-functions"],
  failure: ["no-var", "var-on-top", "linebreak"],
  skipped: ["id-blacklist", "no-dup-keys"]
};
function makeList(arr) {
  "use strict";

  // change code below this line
  const resultDisplayArray = arr.map((x) => `<li class="text-warning">${x}</li>`);
  // change code above this line

  return resultDisplayArray;
}
/**
 * makeList(result.failure) should return:
 * [ <li class="text-warning">no-var</li>,
 *   <li class="text-warning">var-on-top</li>, 
 *   <li class="text-warning">linebreak</li> ]
 **/
const resultDisplayArray = makeList(result.failure);

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals

3 Likes

Hi,

I re-tested my solution that passed recently and now it is not passing.

Clearly something about the test has changed and is possibly a bug.

I have the same problem

I’m getting the error “Invalid regular expression flags,” and template strings were used not being checked off even though the solution I posted is it.

OK - there are at least two bugs in this challenge. They have both been reported.

Any solution that uses bracket notation will probably fail due to a regular expression in the test suite that only allows for letters and spaces in the template string.

`<li class="text-warning">${arr[0]}</li>`  // probably won't pass

The Invalid regular expression flags problem is possibly a result of an attempt to remedy the previous error. I didn’t see this one appear until sometime Saturday night.

I don’t know that the challenge can be passed in the current state.

2 Likes

Good news. The developers are aware of the bug and have a solution that should be pushed into production in the next few days. Until then it would probably just be best to skip that challenge

7 Likes

Thanks for the update. This was driving me nuts.

1 Like

I wish the developers could fix this issue very soon. :slight_smile:

1 Like

facing the same problem here. Wish the issue will be fixed soon.

I’m just replying to this so hopefully I will get a notification where there’s an update and this can be completed.

1 Like

Same here…

Same problem here…

Same problem.
I dont get, why i sit here and try to learn something if Platform have multiple bugs.
So annoying, i cant believe this…

Same here! i took more than 3 hours in it, and now kinda relieved that its a bug

Ooooh. I spent a lot of time trying to figure out what is going on! :sweat:

Is there a way to pass this on the state it is?

do you mean is there a way to skip the challenge? (I’m just guessing what you meant so sorry if that is completely wrong).
Yes there is a way to skip. Just go to the curriculum page and click the following challenge , ignoring this one for now.

1 Like

No, @hbar1st. I mean, knowing issue with test, code something that pass and validate progress.

unfortunately there is no way to pass the challenge at the moment. The fix has been made to the FCC code last I heard but the updated code has not been put into the production environment we use yet.

1 Like

Thanks a lot, @hbar1st. I’m a systematic person. I’m waiting for the fix to then continue with lessons. I don’t want do continue skipping this for two reasons, first, I really don’t like. Second, I’ll probably forget to come back further. Anyway, I hope they can fix the issue soon, I was very excited with course.