P
P
poolpyos2019-10-06 11:14:31
JavaScript
poolpyos, 2019-10-06 11:14:31

Why does the code map error pop up?

When reloading the page, the following error flies to the browser console:


Code map error: request failed with status 404
Resource URL: localhost:3000/_nuxt/vendors.app.js
Code map URL: unfetch.mjs.map

Googled but didn't find a solution. Client code:
sendRequestLogin(e) {
      if (this.loginInput === '' || this.passwordInput === '') {
        this.emptyInput = 'Invalid data'
      }

      this.$axios
        .post('/login', {
          name: this.loginInput,
          password: this.passwordInput
        })
        .then(res => {
          if (res.data.auth === true) {
            this.$emit('close', res.data)
            this.$emit('login', res.data)
          }

          if (res.data.auth === false) {
            this.emptyInput = res.data.text
          }
        })

        .catch(err => {
          consola.log(err)
        })
    },

And the server code:
app.post('/login', function(req, res) {
  // authorization
  const nick = req.body.name
  const password = req.body.password

  db.all(SQLCHeck, [], (err, row) => {
    if (row.length === '0') {
      const jSON = JSON.stringify({
        auth: false,
        text: 'Wrong login or password!'
      })

      return res.send(jSON)
    }

    if (err) {
      return consola.log(err.message)
    }

    const dataLogin = {
      auth: true,
      userNick: nick
    }

    const jSON = JSON.stringify(dataLogin)

    return res.send(jSON) // send data{} to client
}

What do i do?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question