Skip to content

fix: Lazy-load vscode-nsfw to support RHEL 8#14058

Merged
nachocodoner merged 5 commits intometeor:release-3.4.1from
sanki92:fix-rhel8-vscode-nsfw
Mar 24, 2026
Merged

fix: Lazy-load vscode-nsfw to support RHEL 8#14058
nachocodoner merged 5 commits intometeor:release-3.4.1from
sanki92:fix-rhel8-vscode-nsfw

Conversation

@sanki92
Copy link
Copy Markdown
Contributor

@sanki92 sanki92 commented Dec 16, 2025

Problem

Meteor crashes on RHEL 8 / Rocky Linux 8 / AlmaLinux 8:

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found
(required by .../vscode-nsfw/build/Release/nsfw.node)

RHEL 8 has GLIBCXX_3.4.25, but vscode-nsfw needs 3.4.26. The import nsfw from 'vscode-nsfw' in safe-watcher-legacy.ts loads immediately at startup, even when using modern mode with @parcel/watcher.

Solution

Lazy-load vscode-nsfw only when watcherLibrary === 'nsfw':

let nsfw: any = null;
function getNsfw() {
    if (nsfw === null) {
        try {
            nsfw = require('vscode-nsfw');
        } catch (error: any) {
            console.error('Failed to load vscode-nsfw:', error.message);
            nsfw = false;
            watcherEnabled = false;
        }
    }
    return nsfw;
}

Changes

  • Removed top-level vscode-nsfw import
  • Added getNsfw() lazy-loading function
  • Updated fireNames and addWatchRoot() to use getNsfw()
  • Falls back to polling if native module fails

Testing

Tested on Rocky Linux 8:

Before fix:

$ meteor --version
node:internal/modules/cjs/loader:1846
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /root/.meteor/packages/meteor-tool/.3.3.1.mmbrzi3t9w++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/vscode-nsfw/build/Release/nsfw.node)
    at Object..node (node:internal/modules/cjs/loader:1846:18)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1423:32)
    at Module.Mp.load (/tools/static-assets/server/runtime.js:35:31)
    at Function._load (node:internal/modules/cjs/loader:1246:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1445:12)
    at Module.mod.require (/root/.meteor/packages/meteor-tool/.3.3.1.mmbrzi3t9w++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/@meteorjs/reify/lib/runtime/index.js:30:33)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/root/.meteor/packages/meteor-tool/.3.3.1.mmbrzi3t9w++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/vscode-nsfw/js/src/index.js:4:14) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v22.18.0

After fix:

$ meteor --version --allow-superuser
Meteor 3.3.2

$ meteor --help
Usage: meteor [--release <release>] [--help] <built-in command> [args]
       meteor help <built-in command>
       meteor [--version] [--arch]
...

$ meteor create test-app --bare
Created a new Meteor app in 'test-app'.

To run your new app:
  cd test-app
  meteor

Fixes #13649

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 16, 2025

Deploy Preview for v3-migration-docs canceled.

Name Link
🔨 Latest commit 00ab433
🔍 Latest deploy log https://app.netlify.com/projects/v3-migration-docs/deploys/6941972dc2de4800097d67e0

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 16, 2025

Deploy Preview for v3-meteor-api-docs ready!

Name Link
🔨 Latest commit 49d7b1d
🔍 Latest deploy log https://app.netlify.com/projects/v3-meteor-api-docs/deploys/6960e993da1f5c00088f9bae
😎 Deploy Preview https://deploy-preview-14058.docs-online.meteor.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nachocodoner nachocodoner added this to the Release 3.4.1 milestone Dec 16, 2025
@nachocodoner
Copy link
Copy Markdown
Member

Looks good. I will follow your steps to reproduce it and validate the fix. Setting it for Meteor 3.4.1.

#13649 (comment)

Thank you so much for your work and detailed PRs! 🚀

// watcher and stop them

nsfw(
nsfwLib(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you fix the indentation, it should match the last for

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

italojs
italojs previously approved these changes Dec 19, 2025
@italojs italojs changed the base branch from devel to release-3.4.1 December 19, 2025 12:37
@italojs italojs dismissed their stale review December 19, 2025 12:37

The base branch was changed.

@nachocodoner
Copy link
Copy Markdown
Member

I’ve seen a failure in the Windows check, but I believe it’s related to flaky behavior that I’m currently investigating. This PR should be fine to merge. I’ll merge it into 3.4.1 shortly.

@nachocodoner nachocodoner merged commit 6190170 into meteor:release-3.4.1 Mar 24, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latest meteor is incompatible with RHEL8

3 participants