Skip to content
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

Problems with tamagui styles on Cloudflare pages #36

Closed
darthwade opened this issue Jul 25, 2023 · 10 comments
Closed

Problems with tamagui styles on Cloudflare pages #36

darthwade opened this issue Jul 25, 2023 · 10 comments

Comments

@darthwade
Copy link

Hi @timothymiller

Thank you so much for your work on T4. Amazing stack!
I have a question, after deployment to Cloudflare pages based on your docs, I see next:
https://zeus-3v5.pages.dev

Could you pls help me in what direction should I dig?
Thanks once more

@darthwade
Copy link
Author

Btw, during deployment I also encountered "Error: Could not access built-in Node.js modules. Please make sure that your Cloudflare Pages project has the 'nodejs_compat' compatibility flag set."

adding node_compat to wrangler.toml didn't help, but applying node_compat via CF dashboard helped

[env.preview]
name = "zeus-web-preview"
workers_dev = true
node_compat = true
compatibility_flags = [ "nodejs_compat" ]

[env.production]
name = "zeus-web"
route = "zeus-3v5.pages.dev/*"
workers_dev = false
node_compat = true
compatibility_flags = [ "nodejs_compat" ]

@timothymiller
Copy link
Owner

Yep you have to set node_compat via the CF dashboard. I'm open to solutions that make that process programatic.

Do you have optimizeCSS set in next.config.js? Turn it off if you do.

@darthwade
Copy link
Author

image disabled

@timothymiller
Copy link
Owner

That's strange. Ensure your fork is up to date with the main branch and re-deploy.

@darthwade
Copy link
Author

darthwade commented Jul 25, 2023

will do, I created it yesterday via pnpm create t4-app, locally looks good

@darthwade
Copy link
Author

Updated to latest version from main branch, so probably there's some problem during building or deployment/cf configuration
https://zeus-3v5.pages.dev

@timothymiller
Copy link
Owner

Make sure your CF deployment is set to node 18!

@darthwade
Copy link
Author

Strange, recreated cf project from scratch with NODE_VERSION 18 env var, but still same problem https://zeus-web.pages.dev
image

@darthwade
Copy link
Author

After adding TAMAGUI_TARGET=web it finally works :)
@timothymiller thanks for help!

"dev": "TAMAGUI_TARGET=web pnpm with-env next dev",
"build": "TAMAGUI_TARGET=web pnpm with-env next build",
"start": "TAMAGUI_TARGET=web pnpm with-env next start",

@timothymiller
Copy link
Owner

@darthwade This was originally set, it must have been removed by a recent PR.

I added it back so other people don't experience this. Thanks for debugging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants