Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circular dependency warning on node v15.5 #15

Open
sachinbhutani opened this issue Jan 3, 2021 · 5 comments
Open

circular dependency warning on node v15.5 #15

sachinbhutani opened this issue Jan 3, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@sachinbhutani
Copy link
Contributor

I get the following circular dependency warnings when running on node version 15.5

(node:1585) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1585) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:1585) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
@BetaHuhn
Copy link
Collaborator

BetaHuhn commented Jan 4, 2021

Hey,

the message circular dependency indicates that one file is importing another file which in turn is importing the first one. It seems Node v15 no longer supports this.

Could you please run node --trace-warnings ... so we can see where the error is coming from?

@BetaHuhn BetaHuhn added the bug Something isn't working label Jan 4, 2021
@sachinbhutani
Copy link
Contributor Author

sachinbhutani commented Jan 5, 2021

Full trace but only the first warning got expanded
seems like the issue is in one another dependency library

(node:1066) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
    at emitCircularRequireWarning (node:internal/modules/cjs/loader:698:11)
    at Object.get (node:internal/modules/cjs/loader:712:5)
    at Object.exports.setLevels (/Users/sachin/sites/node-mailin/node_modules/winston/lib/winston/common.js:35:14)
    at Object.<anonymous> (/Users/sachin/sites/node-mailin/node_modules/winston/lib/winston.js:83:8)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
warn: Either spamassassin or spamc are not available. Spam score computation is disabled.
info: nodeMailin v2.1.1
info: Log file: /var/log/nodeMailin.log
info: Spam score computation is disabled
(node:1067) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1067) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:1067) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
info: NodeMailin Smtp server listening on port 25

@BetaHuhn
Copy link
Collaborator

BetaHuhn commented Jan 5, 2021

info: nodeMailin v2.1.1

I just noticed you are not using the latest version of node-mailin. Try installing the latest version v2.4.0 and see if the error is coming up again.

I also can't reproduce the error on Node v15.5 with the latest version of node-mailin or the version you are using. Are you running it from the command line or inside a node application?

seems like the issue is in one another dependency library

Indeed, the error is coming from winston and was already reported in #1797 and fixed in 2.4.5.

@sachinbhutani
Copy link
Contributor Author

sachinbhutani commented Jan 5, 2021

thanks @BetaHuhn
I just did a git clone before running this.
I see package.json in #master branch has version 2.1.1, do you need to bump the version in #master ?
https://github.com/vithalreddy/node-mailin/blob/master/package.json
winston version in package.json is also 2.4.2

@BetaHuhn
Copy link
Collaborator

BetaHuhn commented Jan 5, 2021

I see package.json in #master branch has version 2.1.1, do you need to bump the version in #master ?

Oh, yes it is. Will fix this later, thanks for pointing it out!

I just tried to use node-mailin on Node v15.5 by cloning it directly and can now reproduce your error. I will take a closer look at it tomorrow and make sure the version on NPM is the same as in this repo. Maybe @vithalreddy can help me with this as I don't have write access to the NPM package.

For now, the best thing to do is installing the latest version via NPM:

npm install -g node-mailin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants