V
V
Vladimir2019-10-17 08:19:05
Node.js
Vladimir, 2019-10-17 08:19:05

I am developing an authorization module on node.js, there was one error, I fixed it, a new one appeared, what should I do?

Good morning.

SyntaxError: Identifier 'user' has already been declared
    at pass (C:\Users\History\Desktop\session\node_modules\passport\lib\authenticator.js:353:25)
    at Authenticator.deserializeUser (C:\Users\History\Desktop\session\node_modules\passport\lib\authenticator.js:362:5)
    at SessionStrategy.authenticate (C:\Users\History\Desktop\session\node_modules\passport\lib\strategies\session.js:60:10)
    at attempt (C:\Users\History\Desktop\session\node_modules\passport\lib\middleware\authenticate.js:361:16)
    at authenticate (C:\Users\History\Desktop\session\node_modules\passport\lib\middleware\authenticate.js:362:7)
    at Layer.handle [as handle_request] (C:\Users\History\Desktop\session\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\History\Desktop\session\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\History\Desktop\session\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\History\Desktop\session\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\History\Desktop\session\node_modules\express\lib\router\index.js:275:10)

I do not understand what happened, I will add the code if necessary, please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2019-10-17
@HistoryART

just read the error carefully, it speaks quite unambiguously about your problem, to reproduce it, press f12, and repeat the example below in the console

const user = {}
>undefined
const user = {}
>VM179:1 Uncaught SyntaxError: Identifier 'user' has already been declared
>    at <anonymous>:1:1

Highlighted with > browser responses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question