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
I built a fairly simple solid-start app (although probably any SSR app such as Next.js would also suffer this problem), and added znv, and while the resulting vite dev environment runs it fine, deployment to either Vercel or CloudFlare Pages fails with the server function unable to import module tty.
For example, with Vercel:
> vercel --yes --prod
Vercel CLI 32.7.2
🔍 Inspect: https://vercel.com/appurist/market/3bS4bgYzUUec8N7LtvpSxHF1V4qW [3s]
✅ Production: https://market-eq1iht44q-appurist.vercel.app [3s]
Error: The Edge Function "render" is referencing unsupported modules:
- vercel/path0/dist/index.mjs: tty
CloudFlare deploy is more descriptive:
01:21:10.817 ✘ [ERROR] Could not resolve "tty"
01:21:10.818
01:21:10.818 [[path]].js:1:21:
01:21:10.818 1 │ import * as tty from 'tty';
01:21:10.818 ╵ ~~~~~
01:21:10.818
01:21:10.818 The package "tty" wasn't found on the file system but is built into node.
01:21:10.819 Add the "nodejs_compat" compatibility flag to your Pages project to enable Node.js compatibility.
However adding nodejs_compat or changing the import to 'node:tty' did not help.
Perhaps the import of colorette (or tty) in znv can be eliminated, or at least more optional, e.g. with a dynamic require('node:tty') and a conditional check before use (rather than import failing immediately). The usage in question is this line:
I believe this is in colorette so znv usage is indirect. However, I need to ask why an environment parsing library needs colorized console output? Perhaps that can just be dropped. My workaround was to eliminate my use of znv in my project as it was just a nice-to-have anyway. (Deployment was successful without znv.)
The text was updated successfully, but these errors were encountered:
I built a fairly simple
solid-start
app (although probably any SSR app such as Next.js would also suffer this problem), and addedznv
, and while the resultingvite dev
environment runs it fine, deployment to either Vercel or CloudFlare Pages fails with the server function unable to import moduletty
.For example, with Vercel:
CloudFlare deploy is more descriptive:
However adding
nodejs_compat
or changing the import to'node:tty'
did not help.Perhaps the import of
colorette
(ortty
) inznv
can be eliminated, or at least more optional, e.g. with a dynamicrequire('node:tty')
and a conditional check before use (rather thanimport
failing immediately). The usage in question is this line:I believe this is in
colorette
soznv
usage is indirect. However, I need to ask why an environment parsing library needs colorized console output? Perhaps that can just be dropped. My workaround was to eliminate my use ofznv
in my project as it was just a nice-to-have anyway. (Deployment was successful withoutznv
.)The text was updated successfully, but these errors were encountered: