-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@vanilla-extract/css dependency on chalk
breaks deployment to Cloudflare Workers
#756
Comments
@patryk-szydlowski This library might work as an alternative. I think it safely checks for process.env and falls back to no color output. I’m away from computer but will check when I get time. |
TBH I'm surprised Alternatively, I'm open to a PR to migrate to a non-node specific option. However, not sure how simple that'd be without creating a browser specific bundle which is a bit of a rabbit hole. |
I see that And |
@pladaria It shouldn't be. Is @vanilla-extract/css declared as a dev dependency in your app? |
No, it was set as a regular dependency. I can change that but that shouldn't affect the webpack output. I will investigate edit: After investigating, I saw that some components were using |
|
Describe the bug
When building a project using vanilla-extract with vite and targeting cloudflare workers, there are Node-specific imports in the bundle (
os
,tty
,process
). CF workers are built on v8 and don't support these Node APIs. Tracking it down leads to this dependency on chalk: https://github.com/seek-oss/vanilla-extract/blob/0bc4e0a164e9167e0356557f8feee42d7889d4b1/packages/css/src/validateContract.ts#L17-L32After removing dependency on
chalk
in the above file, these Node imports are not present in the bundle and it successfully deploys to cloudflare. Here is a hacky patch that got the build working:https://github.com/patryk-szydlowski/solid-cloudflare-example/blob/d2eac8fd12eec98bbaec4590f35a3e9dae8d754d/patches/%40vanilla-extract%2Bcss%2B1.7.2.patch
Reproduction
https://github.com/patryk-szydlowski/solid-cloudflare-example/tree/983843b42533c9c18e72d063eae70fb90d048d2b
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: