GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bootstrap: improve snapshot unsupported builtin warnings · nodejs/node@2581fce

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/main
    • mksnapshot.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/main/mksnapshot.js‎

Copy file name to clipboardExpand all lines: lib/internal/main/mksnapshot.js
+13-4Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {
1919
const { isExperimentalSeaWarningNeeded } = internalBinding('sea');
2020

2121
const { emitExperimentalWarning } = require('internal/util');
22-
22+
const { emitWarningSync } = require('internal/process/warning');
2323
const {
2424
getOptionValue,
2525
} = require('internal/options');
@@ -29,6 +29,7 @@ const {
2929
namespace: {
3030
addSerializeCallback,
3131
addDeserializeCallback,
32+
isBuildingSnapshot,
3233
},
3334
} = require('internal/v8/startup_snapshot');
3435

@@ -119,10 +120,18 @@ function requireForUserSnapshot(id) {
119120
err.code = 'MODULE_NOT_FOUND';
120121
throw err;
121122
}
122-
if (!supportedInUserSnapshot(normalizedId)) {
123+
if (isBuildingSnapshot() && !supportedInUserSnapshot(normalizedId)) {
123124
if (!warnedModules.has(normalizedId)) {
124-
process.emitWarning(
125-
`built-in module ${id} is not yet supported in user snapshots`);
125+
// Emit the warning synchronously in case we don't get to process
126+
// the tick and print it before the unsupported built-in causes a
127+
// crash.
128+
emitWarningSync(
129+
`It's not yet fully verified whether built-in module "${id}" ` +
130+
'works in user snapshot builder scripts.\n' +
131+
'It may still work in some cases, but in other cases certain ' +
132+
'run-time states may be out-of-sync after snapshot deserialization.\n' +
133+
'To request support for the module, use the Node.js issue tracker: ' +
134+
'https://github.com/nodejs/node/issues');
126135
warnedModules.add(normalizedId);
127136
}
128137
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.