Workaround explorer project not working

When I import the workaround functions to Main.js the program stops working. I cannot figure out why?

From what I remember, you have to import modules from salaryData.js to the workaroundExplorer file and import modules from that file to main.js.
Open the browser’s console and check the error messages: If it logs that a file can’t be found, you probably have an error in your file path. If it logs that anything is undefined or null, you probably imported modules in the wrong file.

How do I open the browser console to check the errors? Would’ve been very helpful when I started the project lol. I was like I can’t check errors and there is no video! :rofl::rofl:

I know. Once you took the wrong turn in this project, you can get lost completely.
I think the development tools are preinstalled on almost all browsers now. So right click on any element in your project. I’m not 100% sure which english term will appear: It must be something like ‘inspect’. If you click that, it opens the dev toolbar with the console.


import {getDataByRole, getDataByCompany} from ‘./modules./salaryData.js’;
import salaryData from ‘./modules./salaryData.js’

This is where the problem was. File path was incorrect. I changed it to ‘./salaryData.js’ and everything is working now. Thank you for your help! The inspect window showed the console errors and eventually led me to this solution.
I still feel the correct file path is ‘./modules/salaryData.js’ because salary.js is in the modules folder but for some reason the program won’t run with that file path.

So you found the issue, nice job!
The files workAroundModule.js and salaryData.js are in the same directory. If you import modules to workAroundModule.js from salaryData.js and the path is ./modules./salaryData.js the program will look for the folder /modules in the very same folder.

1 Like