sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.87k stars 136 forks source link

Warning is output with Node.js 14 #403

Closed fu-sen closed 3 years ago

fu-sen commented 4 years ago

I updated to the new version of Node.js 14.0.0, which was recently published. Then surge will always return the following output:

(node:8280) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)

Of these, 8280 is random. the operation of surge CLI itself works.

sintaxi commented 4 years ago

Thanks for reporting. We'll look into it!

fu-sen commented 4 years ago

Node.js has been updated to 14.1.0. This issue continues. (I use Windows 10 PowerShell)

> surge --version

   v0.21.3

(node:6752) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
jfarmer commented 4 years ago

For anyone reading this, the underlying issue is with the https://github.com/winstonjs/winston logging library. See https://github.com/winstonjs/winston/issues/1797

The message is the result of new error logging added in Node 14 (https://github.com/nodejs/node/pull/29935).

sintaxi commented 4 years ago

@jfarmer thank you for the info. It helps a lot.

syabro commented 3 years ago

@sintaxi whinston fix https://github.com/winstonjs/winston/pull/1800 was merged a while ago Could you update deps?

syabro commented 3 years ago

Hmm, looks like prompt is not maintained anymore. I think the best solution here is to switch to https://www.npmjs.com/package/prompts or https://www.npmjs.com/package/enquirer

sintaxi commented 3 years ago

@syabro thanks. What do you suppose is the easiest solution for taking care of the warning?

syabro commented 3 years ago

@sintaxi actually AFAIS prompt is being imported only https://github.com/sintaxi/surge/blob/86f3b43091609e80564e8998a6718196370ca1fd/lib/middleware/util/helpers.js#L1 But moreover it's not being used. So I think you can just remove it.

syabro commented 3 years ago

Also I would strongly recommend to add eslint with https://eslint.org/docs/rules/no-unused-vars

sintaxi commented 3 years ago

Thanks for doing the heavy lifting @syabro.

I just released surge@0.21.7 which removes prompt which should resolve these CLI issues on node@14.x.

fu-sen commented 3 years ago

I ran npm i -g surge and saw this improvement. Thank you for the improvement! 😄

sintaxi commented 3 years ago

@fu-sen you're welcome!