I can't seem to fix this error: TextDecoderFatal ?= new TextDecoder('utf8', { fatal: true });

It appears to be a node version error, but the fix requires access to the node modules which I don’t appear to have access to. Is there anyone else that has this error or knows a fix that works in glitch?

Full error: /rbd/pnpm-volume/9f8c7378-ee65-4350-aa8c-d9795f35beda/node_modules/@fastify/mongodb/node_modules/bson/lib/bson.cjs:155TextDecoderFatal ??= new TextDecoder(‘utf8’, { fatal: true });

SyntaxError: Unexpected token ‘??=’
10:21 AM
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
10:21 AM
at Module._compile (internal/modules/cjs/loader.js:1049:27)
10:21 AM
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
10:21 AM
at Module.load (internal/modules/cjs/loader.js:950:32)
10:21 AM
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
10:21 AM
at Module.require (internal/modules/cjs/loader.js:974:19)
10:21 AM
at require (internal/modules/cjs/helpers.js:101:18)
10:21 AM
at Object. (/rbd/pnpm-volume/9f8c7378-ee65-4350-aa8c-d9795f35beda/node_modules/@fastify/mongodb/node_modules/mongodb/lib/bson.js:9:16)
10:21 AM
at Module._compile (internal/modules/cjs/loader.js:1085:14)
10:21 AM
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)

1 Like

was this syntax available in node.js 16? you can try updating your node version to see if it helps

or maybe downgrade the bson library somehow