0%

Accessing non-existent property 'column' of module exports inside circular dependency (Node+Hexo)

Fix for Hexo + Node v14 'Accessing non-existent property' errors
  • Version: Node 14.16.0, Hexo 5.4.0
  • Platform: Windows_NT 10.0.18363 win32 x64

What steps will reproduce the bug?

​ Every time I run hexo s command.

How often does it reproduce? Is there a required condition?

​ It starts yesterday after I did some changes to my github page, and it produces the warning every time I run hexo at localhost.

What is the expected behavior?

1
2
3
4
$ hexo s
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

What do you see instead?

1
2
3
4
5
6
7
8
9
10
11
$ hexo s
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
(node:9352) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9352) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:9352) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:9352) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:9352) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:9352) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency

Solution

​ I went through Node 14 with warning (node:31518) Warning: Accessing non-existent property 'column' of module exports inside circular dependency #32987 and found Fix for Node v14 'Accessing non-existent property' errors #2538.

​ Although I wasn't able to reproduce the error as said in the Fix, the output warning is exactly the same as what I've gone through. So I managed to find two lib\nodes\index.js files in my blog folder. myBlog\node_modules\nib\node_modules\stylus\lib\nodes\index.js and myBlog\node_modules\stylus\lib\nodes\index.js.

​ After checking the two files, I found that the previous file missing three lines of code compared to the Fix. The warning disappeared after adding the following code.

1
2
3
exports.lineno = null;
exports.column = null;
exports.filename = null;

References

  • https://github.com/nodejs/node/issues/32987

  • https://github.com/stylus/stylus/pull/2538