fix: read NUXT_CF_ACCOUNT_ID and NUXT_CF_API_TOKEN from process.env - #315
Open
flingyp wants to merge 1 commit into
Open
fix: read NUXT_CF_ACCOUNT_ID and NUXT_CF_API_TOKEN from process.env#315flingyp wants to merge 1 commit into
flingyp wants to merge 1 commit into
Conversation
…ariables nuxt.config.ts hardcoded cfAccountId and cfApiToken as empty strings, which prevented the Nuxt build from picking up these values from environment variables (NUXT_CF_ACCOUNT_ID / NUXT_CF_API_TOKEN). As a result, all Analytics Engine SQL API calls (/api/stats/*, /api/logs/*) failed with 404 because the Worker had no credentials to query Cloudflare Analytics Engine. Fixed by reading from process.env, consistent with how siteToken already works.
Owner
|
你是怎么部署的? 我现在无法复现这个问题 Workers Pages 部署我都没这样的问题 方便发一下你的配置方式吗? |
Author
Owner
Author
|
好的,我尝试下 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



cfAccountIdandcfApiTokenare hardcoded as empty strings, so Nuxt never picks up theNUXT_CF_ACCOUNT_ID、NUXT_CF_API_TOKENenvironment variables at build time. This causes all Analytics Engine API endpoints (/api/stats/*,/api/logs/*) to return404 Server Error— the Worker has no credentials to query the analytics database.siteTokenalready reads fromprocess.env. This PR makes the other two variables consistent: