Comments (3)
I tested Less.js 4.2.0 on Node 18 and run into no issues requiring and using less.
That said, removing the property less from import manager seems to have no adverse effect. All tests pass with this particular circular reference removed.
I am sure that is not the only circular reference in Less 4.2.0.
from less.js.
OK, thanks. There are indeed many loops in webpack configs.
I change the implement of print JSON.stringify(webpackConfigs) to solve this question replace with node:util inspect()
.
The old way is use the parameter replacer
of the JSON.stringify() to solve circular data. Which cause Node16 crash when the webpack configs has many circular reference and too big. refer to https://stackoverflow.com/a/11616993.
JSON.safeStringify = (obj, indent = 2) => {
let cache = [];
const retVal = JSON.stringify(
obj,
(key, value) =>
typeof value === "object" && value !== null
? cache.includes(value)
? undefined // Duplicate reference found, discard key
: cache.push(value) && value // Store value in our collection
: value,
indent
);
cache = null;
return retVal;
};
// Example:
console.log('options', JSON.safeStringify(options))
#
# Fatal error in , line 0
# Check failed: has_pending_exception().
#
#
#
#FailureMessage Object: 0x16f995318
1: 0x100583d20 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
2: 0x10132b414 V8_Fatal(char const*, ...) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
3: 0x1007953a8 v8::internal::Isolate::is_catchable_by_wasm(v8::internal::Object) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
4: 0x100e25dc0 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
5: 0x100db9898 Builtins_InterpreterEntryTrampoline [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
6: 0x100db9898 Builtins_InterpreterEntryTrampoline [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
7: 0x100db9898 Builtins_InterpreterEntryTrampoline [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
8: 0x100deb06c Builtins_GeneratorPrototypeNext [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
9: 0x105a13b78
10: 0x100e6dd38 Builtins_PromiseFulfillReactionJob [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
11: 0x100ddb274 Builtins_RunMicrotasks [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
12: 0x100db7564 Builtins_JSRunMicrotasksEntry [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
13: 0x100784570 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
14: 0x1007849a4 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
15: 0x100784a90 v8::internal::Execution::TryRunMicrotasks(v8::internal::Isolate*, v8::internal::MicrotaskQueue*, v8::internal::MaybeHandle<v8::internal::Object>*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
16: 0x1007a749c v8::internal::MicrotaskQueue::RunMicrotasks(v8::internal::Isolate*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
17: 0x1007a7d30 v8::internal::MicrotaskQueue::PerformCheckpoint(v8::Isolate*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
18: 0x1006e164c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
19: 0x1006e1144 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
20: 0x1006e0a00 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
21: 0x100e25d4c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
22: 0x1052cc178
23: 0x100db768c Builtins_JSEntryTrampoline [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
24: 0x100db7324 Builtins_JSEntry [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
25: 0x1007845a8 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
26: 0x100783c44 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
27: 0x1006905f4 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
28: 0x100469edc node::InternalCallbackScope::Close() [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
29: 0x1004697c4 node::InternalCallbackScope::~InternalCallbackScope() [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
30: 0x1004ce684 node::Environment::RunTimers(uv_timer_s*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
31: 0x100d98718 uv__run_timers [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
32: 0x100d9b74c uv_run [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
33: 0x10046acb8 node::SpinEventLoop(node::Environment*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
34: 0x10055dadc node::NodeMainInstance::Run(int*, node::Environment*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
35: 0x10055d7a8 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
36: 0x1004f76bc node::Start(int, char**) [/Users/shiftj/.nvm/versions/node/v16.15.0/bin/node]
37: 0x10512108c
from less.js.
The short answer is that Less was created before many modern import conventions. I think the other reason is that the importManager is passed to plugins, but then less
was added so that it can be used as well? Not sure.
from less.js.
Related Issues (20)
- sys import doesn't work with nodejs 18 HOT 3
- "Selector Interpolation with Extend" possibly contains outdated info (doc states not supported, but works) HOT 5
- Adding a default value to a mixin causes arity match failure HOT 2
- Container style queries unexpected space HOT 8
- Can not find variable when a variable be created in plugin. HOT 2
- Nested @layer rule lost scope HOT 1
- Mixin calls with empty parentheses shouldn't match with classes with the same name
- less variables cannot be used under the not selector, delimiter HOT 1
- 网络安全漏洞修复
- Whether the official statement "Selectors with variables will not match" is wrong? HOT 1
- @font-face doesn't respect scope when compiling HOT 2
- In version 4.2.0, a container query in a mixin that uses a LESS variable doesn't use the right value when the mixin is called multiple times with different values
- `mask-repeat: no-repeat` being transformed into `mask-repeat: initial` in production mode HOT 1
- Empty calculation passed to css in 4.2.0 HOT 4
- less does not compile using vite anymore HOT 1
- Variable interpolation with math operator like + is not compiling properly HOT 1
- Comments with doubleslash are not stripped before compile
- @starting-style doesn't nest correctly HOT 1
- Nested pseudo-selectors that take selectors eport missing a closing ')' when separated by commas
- Lessc to provide preserve comments option
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 less.js.