WorkAround Explorer - JS Modules

Hi Guys,

I’ve been stuck for a while on step 4 of WorkAround Explorer and unfortunately there is no video or even solution code available. I was wondering if anyone could have a look?

STEP 1 (my code in salaryData.js) :

export {getRoles, getCompanies, getDataByRole, getDataByCompany};

export default SalaryData;

STEP 2 (my code in main.js) :

import {getRoles, getCompanies} from './modules/salaryData.js'

(also tried from ‘modules/salaryData.js’

STEP 3 (my code in main.js):

const companies = getCompanies();
const roles = getRoles();

STEP 4 (my code in index.html):

 <script type="module" src="main.js" defer></script>

it should now display radio buttons but unfortunately is not. Am i missing something? :thinking:

Hi, Your problem is here:

export default SalaryData;

The function starts with lowercase salaryData
Everything else looks correct. Hope this solves your problem.

@pavldn By the way, the browser developer tools would be showing you the following error:

Uncaught ReferenceError: SalaryData is not defined
    at VM37 salaryData.js:33

To help with this project I suggest you enable DevTools in your browser as you may have future problems like this that are very hard to debug without the console.

This can help to find the console in your browser: Finding Your Browser's Developer Console | Balsamiq
Here is a vid on how to do step by step debugging with Chrome DevTools Debugging JavaScript - Chrome DevTools 101 - YouTube

1 Like