You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\nodejs18\node.exe .\demo.js
error at line [1], column [2] Error: Non-whitespace before first tag.
Line: 0
Column: 1
Char: �
at error (D:\Internet\xml-twig\node_modules\sax\lib\sax.js:652:10)
at strictFail (D:\Internet\xml-twig\node_modules\sax\lib\sax.js:678:7)
at beginWhiteSpace (D:\Internet\xml-twig\node_modules\sax\lib\sax.js:952:7)
at SAXParser.write (D:\Internet\xml-twig\node_modules\sax\lib\sax.js:1007:11)
at SAXStream.write (D:\Internet\xml-twig\node_modules\sax\lib\sax.js:240:18)
at ReadStream.ondata (d:\Internet\xml-twig\lib\internal\streams\readable.js:777:22)
at ReadStream.emit (d:\Internet\xml-twig\lib\events.js:517:28)
at addChunk (d:\Internet\xml-twig\lib\internal\streams\readable.js:335:12)
at readableAddChunk (d:\Internet\xml-twig\lib\internal\streams\readable.js:308:9)
at Readable.push (node:internal/streams/readable:245:10) {stack: 'Error: Non-whitespace before first tag.
Line:….push (node:internal/streams/readable:245:10)', message: 'Non-whitespace before first tag.
Line: 0
Column: 1
Char: �'}
Uncaught TypeError TypeError: Cannot read properties of undefined (reading 'text')
at <anonymous> (file:///D:/Internet/xml-twig/twig.js:319:30)
at emit (node:events:517:28)
at me._parser.<computed> (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:259:17)
at emit (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:625:35)
at closeText (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:635:26)
at error (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:646:5)
at strictFail (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:678:7)
at write (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:1036:15)
at SAXStream.write (file:///D:/Internet/xml-twig/node_modules/sax/lib/sax.js:240:18)
at ondata (node:internal/streams/readable:777:22)
at emit (node:events:517:28)
at addChunk (node:internal/streams/readable:335:12)
at readableAddChunk (node:internal/streams/readable:308:9)
at Readable.push (node:internal/streams/readable:245:10)
at <anonymous> (node:internal/fs/streams:277:14)
at wrapper (node:fs:684:5)
at callbackTrampoline (node:internal/async_hooks:130:17)
--- FSREQCALLBACK ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at read (node:fs:687:15)
at ReadStream._read (node:internal/fs/streams:250:6)
at Readable.read (node:internal/streams/readable:507:12)
at maybeReadMore_ (node:internal/streams/readable:661:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
--- TickObject ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at emitInitScript (node:internal/async_hooks:504:3)
at nextTick (node:internal/process/task_queues:132:5)
at maybeReadMore (node:internal/streams/readable:628:13)
at <anonymous> (node:internal/streams/readable:216:7)
at onceWrapper (node:events:631:28)
at emit (node:events:517:28)
at emitConstructNT (node:internal/streams/destroy:284:10)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
--- TickObject ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at emitInitScript (node:internal/async_hooks:504:3)
at nextTick (node:internal/process/task_queues:132:5)
at onConstruct (node:internal/streams/destroy:270:15)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
--- TickObject ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at emitInitScript (node:internal/async_hooks:504:3)
at nextTick (node:internal/process/task_queues:132:5)
at <anonymous> (node:internal/streams/destroy:276:15)
at <anonymous> (node:internal/fs/streams:76:9)
at <anonymous> (node:fs:200:23)
at callbackTrampoline (node:internal/async_hooks:130:17)
--- FSREQCALLBACK ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at open (node:fs:578:15)
at _construct (node:internal/fs/streams:71:17)
at constructNT (node:internal/streams/destroy:275:12)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
--- TickObject ---
at init (node:internal/inspector_async_hook:25:19)
at emitInitNative (node:internal/async_hooks:202:43)
at emitInitScript (node:internal/async_hooks:504:3)
at nextTick (node:internal/process/task_queues:132:5)
at construct (node:internal/streams/destroy:241:11)
at Readable (node:internal/streams/readable:214:15)
at ReadStream (node:internal/fs/streams:214:3)
at createReadStream (node:fs:3038:10)
at <anonymous> (file:///D:/Internet/xml-twig/demo.js:6:4)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (node:internal/modules/run_main:86:12)
at <anonymous> (node:internal/main/run_main_module:23:47)
Process exited with code 1
The text was updated successfully, but these errors were encountered:
According to W3C Recommendations every XML processor must be able to read UTF-8 and UTF-16 encodings. A XML file encoded in UTF-16
throws an error:
The text was updated successfully, but these errors were encountered: