Byte
When making the switch from CommonJS modules to ES modules, there are a few differences you'll notice. One error you'll likely run into is "Uncaught ReferenceError: __dirname is not defined in ES module scope". This error is exactly what it sounds like, the global __dirname variable is not...
Scott Robinson
A common error you'll run into, especially when transitioning from writing JavaScript in the Node runtime to writing JavaScript in the browser, is "Uncaught ReferenceError: require is not defined". The two environments have different ways of importing modules, so trying to import code in the browser like you...
A common error we see, especially among people who are new to JavaScript, is that they try to use the import statement when CommonJS is being used, which only uses the require statement. This results in the error "Uncaught SyntaxError: cannot use import statement outside a module". If...
Relative paths are convenient in that they specify the path of a file relative to the current working directory. However, they can also cause some issues due to ambiguity, and having the absolute path of a file is needed to be more explicit and avoid errors. Here we'll see how...
Article
Axios is a JavaScript library that uses the Promise API to create HTTP requests with http in Node.js runtime or XMLHttpRequests in the browser. Because these requests are promises, they work with the newer async/await syntax, as well as .then() functions for promise chaining and the .catch() mechanism...
Joel Olawanle
Multipart/Form-Data is one of the encoding types that allows files to be included in your form data before it's transferred to the server for processing. Other encoding types can be used to achieve non-file transfers: application/x-www-form-urlencoded - Encodes data as a query string - separating key-value pairs (assigned...
Asaolu Elijah
Nodemon is an open-source utility package that keeps track of the changes made to your source code and restarts your project server automatically when new modifications are made. It also offers some unique features, such as the ability to watch a directory rather than simply files, as well as to...
MySQL is an immensely popular Relational Database Management System (RDBMS) - and has for a long time been a staple in any back-end engineer's toolkit, right next to PostgreSQL. With the advent of JavaScript for the back-end, via Node.js' spectacular rise in popularity and applicability - MySQL is commonly...
Communicating online and staying in touch with people all over the globe has been a major promise from the dawn of the Internet - a web of communication and information. Fairly early on, applications sprung up that connected people all over the globe, allowing them to send messages, multimedia, perform...
Lazar Ristic
© 2013-2024 Stack Abuse. All rights reserved.