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

Fix for Node v14 'Accessing non-existent property' errors #2538

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

3bl3gamer
Copy link
Contributor

Fix for issue #2534

Why it happens

lib/nodes/index.js performs new exports.Boolean(true) which reads nodes.lineno. Since lineno is missing in lib/nodes, node.js outputs warnings. Same is for properties column and filename.

How to reproduce

With node v14:

npm install stylus
node
> require('stylus')

It will output

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

1. Make sure you have tests for your modifications.

Are tests needed for this fix? If so what should they check?

@tcrowe
Copy link

tcrowe commented May 17, 2020

I tested the patch it and it worked. I was getting the warning messages from using stylus and stylus-loader which are included in some webpack projects. Thank you @3bl3gamer

@tacomilkshake
Copy link

All confirmed this solves the issue for me.

@pztrick
Copy link

pztrick commented May 30, 2020

Patch works for me, thanks!

@queengooborg
Copy link

Another confirmation that the patch works -- can't wait for it to be merged so I can get rid of those pesky little warnings!

@peteringram0
Copy link

tested this patch on node v14.4.0 and this fixes the issue. Any update on when this will be merged?

@slightlyfaulty
Copy link

@xdan @dtvn PLEASE merge and release this patch so I don't have to do horrible things like this 😫

https://github.com/slightlyfaulty/stylus-native-loader#stylus-warnings-since-node-v14

Copy link

@simonhaenisch simonhaenisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please 😄

@AlynxZhou
Copy link

@xdan Please also update nib's dependency, it still uses old stylus. Thanks.

thatoddmailbox added a commit to MyHomeworkSpace/client that referenced this pull request Nov 24, 2020
@willbarkoff this hopefully fixes the issues with node v14

see stylus/stylus#2538
manueltimita added a commit to manueltimita/stylus that referenced this pull request Jul 10, 2021
Fix for Node v14 'Accessing non-existent property' errors stylus#2538
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants