developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

[BUG] Nodejs/multer: ReferenceError: alert is not defined #254

Closed developerasun closed 2 years ago

developerasun commented 2 years ago

Describe the bug alert method in Express app not working

To Reproduce Steps to reproduce the behavior:

  1. Go to Node js Express app
  2. Write below codes
        if (/*some error here*/) alert("Choose up to 5 files)
  1. Execute the app
  2. See the error

Expected behavior Express app at localhost showing alert window

Screenshots

alert-not-defined

Additional context Add any other context about the problem here.

Labeling Add a proper label for the issue

developerasun commented 2 years ago

solution: use respond.json or response.send instead

The "ReferenceError: alert is not defined" occurs when the alert() method is used outside of the browser environment, most commonly in Node.js. The alert method is a method on the window object, which is only available in the browser

reference