Ajay
Ajay
CDCloudflare Developers
Created by Ajay on 4/22/2025 in #pages-help
Unable to deploy in Pages despite `nodejs_compat` being set (SvelteKit and `pg`)
Update: I found a nodejs_compat_v2 flag, and I tried that. This should really be in the docs, I found it in some old Github issues but I didn't know it's still a thing. Those errors are now gone, but another one showed up. Will start a new post for that.
4 replies
CDCloudflare Developers
Created by Ajay on 4/22/2025 in #pages-help
Unable to deploy in Pages despite `nodejs_compat` being set (SvelteKit and `pg`)
Full dump
4 replies
CDCloudflare Developers
Created by Ajay on 4/22/2025 in #pages-help
Unable to deploy in Pages despite `nodejs_compat` being set (SvelteKit and `pg`)
02:23:22.597 ✘ [ERROR] Could not resolve "string_decoder"
02:23:22.597
02:23:22.597 ../../node_modules/.pnpm/[email protected]/node_modules/split2/index.js:20:34:
02:23:22.598 20 │ const { StringDecoder } = require('string_decoder')
02:23:22.598 ╵ ~~~~~~~~~~~~~~~~
02:23:22.598
02:23:22.598 The package "string_decoder" wasn't found on the file system but is built into node.
02:23:22.598 - Make sure to prefix the module name with "node:" or update your compatibility_date to 2024-09-23 or later.
02:23:22.597 ✘ [ERROR] Could not resolve "string_decoder"
02:23:22.597
02:23:22.597 ../../node_modules/.pnpm/[email protected]/node_modules/split2/index.js:20:34:
02:23:22.598 20 │ const { StringDecoder } = require('string_decoder')
02:23:22.598 ╵ ~~~~~~~~~~~~~~~~
02:23:22.598
02:23:22.598 The package "string_decoder" wasn't found on the file system but is built into node.
02:23:22.598 - Make sure to prefix the module name with "node:" or update your compatibility_date to 2024-09-23 or later.
I can't prefix the module name since it's in a library, unless I patch it. It should not be this difficult to deploy, so I'm wondering if I'm doing something completely wrong or if the versions are not compatible, though I could not find any documentation to support that.
4 replies