Comments (8)
@vixalien any idea ?
from stylus.
Still happening in 0.61.0.
from stylus.
I can confirm this error, but it doesn't seem to be introduced by 0.60.0
. I hence believe the statement "version 0.59.0 works as expected" is false.
Reproducing:
- Create a project, I named mine
stylus-test
and initialize node withyarn init -y
- Add stylus
yarn add [email protected]
- Create the following
index.js
file
var stylus = require('stylus');
const value = `
$jig---config ?= null
if !($jig---config is a 'object')
if jig---config is defined
$jig---config = jig---config
else if $JIG_CONFIG is defined
$jig---config = $JIG_CONFIG
else if JIG_CONFIG is defined
$jig---config = JIG_CONFIG
if !($jig---config is a 'object')
error('jig:globals | jig config is undefined or not a hash')
`;
stylus(value).render((err, css) => {
if (err) {
throw err;
}
console.log(css);
});
- Run it
$ node index.js
.../stylus-test/index.js:20
throw err;
^
[Error: stylus:12:2
8| else if JIG_CONFIG is defined
9| $jig---config = JIG_CONFIG
10|
11| if !($jig---config is a 'object')
12| error('jig:globals | jig config is undefined or not a hash')
--------^
13|
jig:globals | jig config is undefined or not a hash
] {
fromStylus: true,
lineno: 12,
column: 2,
filename: 'stylus',
stylusStack: ''
}
Node.js v20.5.1
from stylus.
@vixalien 0.59.0 definitely works and by the way, you proved my point above, since the error thrown is exactly what's expected, but the error above is a completely different problem
your example throws my custom error, as expected, but 60/61 throws "cannot perform is 'object' undefined", which is exactly the problem since 60/61 fails at parsing "if !($jig---config is a 'object')"
from stylus.
sorry. It seems I misunderstood your problem.
I updated stylus to 0.61.0
and the error is still:
$ node index.js
.../stylus-test/index.js:20
throw err;
^
[Error: stylus:12:2
8| else if JIG_CONFIG is defined
9| $jig---config = JIG_CONFIG
10|
11| if !($jig---config is a 'object')
12| error('jig:globals | jig config is undefined or not a hash')
--------^
13|
jig:globals | jig config is undefined or not a hash
] {
fromStylus: true,
lineno: 12,
column: 2,
filename: 'stylus',
stylusStack: ''
}
Node.js v20.5.1
Is there something I'm not understanding?
from stylus.
@vixalien no, that would be expected, which is weird, since I just tested the upgrade/downgrade half an hour ago
two differences here:
I do have $JIG_CONFIG = {} previously defined before hitting the check (in another file), which should result in no error anymore and instead $jig---config just being {}
and I still have to use node 16.20 in docker, since intel macs throw segfaults in docker, so my node lts is older then yours (and running in docker, which hopefully does not make a difference here)
from stylus.
Thanks for explaining. It indeed seems the $JIG_CONFIG = {}
was the missing thing. Since I can now reproduce the issue, I'll try to get to what caused it.
Thank you.
from stylus.
Just checked out the new version, everything seems to work again. Thanks a lot!
from stylus.
Related Issues (20)
- JavaScript API `define` need able to return hash Object when second parameter is a function.
- esbuild bundling breaks Stylus compiler due to dependency to `Function.prototype.name` HOT 1
- Operator range (..) does not take into account units. HOT 1
- Please document the difference between the operator '%' and the built-in function 's()'
- Escape is not preserved in class selector
- Function chaining doesn't work
- css :has() selector doesn't work properly HOT 1
- Cameron alfred HOT 1
- review todo list for #2813 HOT 1
- Range Syntax Mediaqueries not working
- Support for the `@layer` rule HOT 1
- Stylus preprocessor has problems with "?" quantifier in regexp HOT 4
- Stylus preprocessor has problems with semicolon ";" in attributes in some cases HOT 2
- Issue with declaring hash and functions with curly braces on newline
- Stylus outputs selectors in wrong (reverse) order HOT 1
- Support for Stylus variables in @container queries just like in @media queries HOT 2
- [Bug] Descendant selector AND general sibling selector with curly bracket in new line causes error
- Unexpected periodic fraction when substracting the integer from the single decimal place fraction HOT 3
- vulnerable @adobe/css-tools HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylus.