Skip to content

Commit

Permalink
Merge pull request #1036 from Uzlopak/node-21
Browse files Browse the repository at this point in the history
fix(env): fix env detection compatibility in node v21.1.0
  • Loading branch information
plainheart authored Nov 2, 2023
2 parents 97f6e72 + 894f408 commit 401e314
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ else if (typeof document === 'undefined' && typeof self !== 'undefined') {
// In worker
env.worker = true;
}
else if (typeof navigator === 'undefined') {
else if (
typeof navigator === 'undefined' ||
navigator.userAgent.indexOf('Node.js') === 0
) {
// In node
env.node = true;
env.svgSupported = true;
Expand Down

0 comments on commit 401e314

Please sign in to comment.