Closed ShaunodCIT closed 8 years ago
Include any relevant information such as what version of node, operating system, code, etc.
Edits made. Thanks.
Can you please provide the code that is causing errors?
Aso is this in your terminal console or browser console you're getting this error?
This is the one line that is causing it: var klapi = require('./klapi.js');
This error is appearing in my browser console.
Node.js is for the server side. Browsers do not implement require. For that to work you need to bundle your code with either Browserify or Webpack.
I have tried doing that and it has resulted in the same error. Is there any other way, other than require(), to do what I'm trying to do?
I really can't help with any more than that without code showing what you're trying to do. Browserify and Webpack are used by thousands of people a day, they work. I use require in the browser because of these tools.
Maybe this is helpful:
Simply as the title says. I'm calling the require() function in my code and the error "Uncaught reference error: require is not define" is being displayed in the console.
Does anyone know what could possible cause this? I'll include links to my code if needs be.
Thank you.
EDITS: Node v5.5.0 OS: Windows 7 Ultimate Language: Javascript