When I use require I get ReferenceError: require is not defined and when I use import/export I get SyntaxError: Cannot use import statement outside a module.
Is it maybe because I am trying to use this commands on JavaScript file that is connected to HTML file? Because when I use this commands in my server.js file (that is not connected to any HTML file) I can normally use require.
If so, how can I overcome this problem. I got JavaScript file connected with each HTML page and I want to import functions to thoose scripts to make code clearer.