No Radio-Style Input in WorkAround Explorer when functions are imported

In the WorkAround Explored project for Intermediate Java Script, found here, I get only the details box when I should get three boxes. If I comment out my import statement in main.js which is;

import { getRoles, getCompanies } from ‘./salaryData.js’;

I will get all three boxes again.
from the guide to the project, I am under the impression that I should see all three boxes again once I change the script line in index.html to;

however the missing first two boxes persists.

incase it matters my export statements in salaryData.js are;

export {getRoles, getCompanies, getDataByRole, getDataByCompany};

export default salaryData;

I have narrowed it down to being something that happens after the import line as if I comment out the import line in main.js I get all three boxes again.

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

This is also the first project I have done where I do not use the console, therefore to mu knowlege I do not have console.log available for debugging.

If I remember correctly, main.js is located in a different directory than salaryData.js, which means that you use an incorrect import path.

Yes, you can still use the console.log. But it is the console for the whole Codecademy page, which means that some logs are irrelevant for your purpose. But it will show your console.logs.

1 Like

Thank you very much, salaryData.js was in a different directory than main.js and the program works now.

1 Like

Hi, can either of you explain this further please?

How is it in a different directory? and how do we access that correctly if it is?

main.js is in the folder ‘files’.
salaryData.js is in the folder ‘modules’.

So you have to apply what you learned about relative paths:

../  // move one level up
./  // start the path in the directory where your current file is located

I get it now! thanks Mairja!

1 Like