Reuse JavaScript Code Using Import [BUG]

Error: TypeError: unknown: (0 , s.extname) is not a function

GitHub Issue: "Reuse JavaScript Code Using import" challenge throws · Issue #41608 · freeCodeCamp/freeCodeCamp · GitHub

We are aware of the problem, and will be looking into fixing it. For now, we suggest you skip this lesson, and return, once the issue has been resolved.

Once this post is unpinned, this indicates the issue has been resolved.

1 Like

Tell us what’s happening:

why am I getting this error :sweat_smile:
TypeError: unknown: (0 , s.extname) is not a function

Your code so far


import { uppercaseString, lowercaseString } from './string_functions.js';
// add code above this line

uppercaseString("hello");
lowercaseString("WORLD!");

Your browser information:

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

Challenge: Reuse JavaScript Code Using import

Link to the challenge:

There is an issue on the github looking into this. So, it is not you but the challenge is broken. For now, just understand what this lesson is teaching, back out of it, and try to move onto the next challenge. You can come back and do this one later. Or not.

1 Like

thanks :+1: Kevin Smith

Tell us what’s happening: I wrote the correct answer but cant pass because of TypeError: unknown: (0 , s.extname) is not a function

Your code so far
import { uppercaseString, lowercaseString} from ‘string_functions.js’;



// Only change code above this line

uppercaseString("hello");
lowercaseString("WORLD!");

Your browser information:

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

Challenge: Reuse JavaScript Code Using import

Link to the challenge:

There is an issue on the github looking into this. So, it is not you but the code is broken. For now, just understand what this lesson is teaching, back out of it, and try to move onto the next challenge. You can come back and do this one later. Or not.

Tell us what’s happening:

My code is working fine and completing all the test cases, it’s just that it’s giving me a warning/error “ReferenceError: require is not defined”. I don’t get it why?

Your code so far


import {uppercaseString, lowercaseString} from './string_functions.js';  
// Only change code above this line

uppercaseString("hello");
lowercaseString("WORLD!");

Your browser information:

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

Challenge: Reuse JavaScript Code Using import

Link to the challenge:

Google Chrome, I’ve been using chrome.

I’m running into this same issue on both Chrome and Firefox.

Hello I’m having the same issue

Just dropped a fix. Sorry about the inconvenience folks and thanks a lot for your continued patience.

3 Likes