Eusebio Trigo
Explore posts from serversCDCloudflare Developers
•Created by Eusebio Trigo on 4/24/2024 in #pages-help
Using next-international makes the app forget the language.
I have my app built and deployed to cloudflare. I have added internationalization using next-international. When I change the language in local, it is kept, and the text is changed accordingly, but when I push the code and it is deployed in Cloudflare, it does not happen anymore.
I could post a video if required. Or access to the deployed environment deployed in CF Pages.
22 replies
Cannot perform I/O on behalf of a different request in Cloudflare Workers
Ok, so this may be a long one...
I have several cloudflare workers that write or request data from Xata.
When I do a single request using the TypeScript SDK, it works OK. When I do several requests like in a await Promise.all(array.map(async arrayElem => queryToXata(arrayElem))), then I get an error like:
This is coming from the Cloudflare Worker SDK, Wrangler.
I have attached the stacktrace.
I have tried creating the xata client on each method I call, so it is separated... but to no avail.
If you request or need more information, i'll be happy to share code, or even do a screensharing session, etc.
I want to discard if this is something from the Xata SDK, or it is something else,...
10 replies
CDCloudflare Developers
•Created by Eusebio Trigo on 2/26/2024 in #workers-help
Execute some code before worker starts
Hi team,
I would like to know if it is possible to execute something in a worker just once, at the start. Example:
- subscribe to webhooks to a 3rd party system.
- set up a "fetch" receiver or an app using Hono.
4 replies
CDCloudflare Developers
•Created by Eusebio Trigo on 11/14/2023 in #pages-help
Error 1101 Worker threw exception
12 replies
Running queries with DISTINCT
Hi team!
Is there a way to run queries with something like .distinct(["column_name"])?
We know about summarize (https://xata.io/docs/sdk/summarize#what-can-summarize-do), but it has a limit on 1000 results (and defaults to 20).
We are aware of the alternative using code and filtering out repeated results... Or running direct SQL queries to the API.
What would be the recommended way?
Thanks!
5 replies
Different results using summarize vs filtering
Hi team (it's me, again),
I'm seeing that, at least in the playground, there is a difference of results when using summaries vs using filtering query (I'll add examples). To make it short, summaries are only returning 20 results, whereas it should be returning more (22, in our current data set).
Is there a limit of the number of results provided by a summarize call? It is returning only 20 results.
I would like you guys to tell me that there is something very wrong in our code. Like we need to call summarize with something different.
Note to Kostas: The workspace and the table and the branch are the same as yesterday 😉
Thanks!
12 replies
Diagnosing Constraint Violation
Hi team!
We are using a direct SQL to update rows in one of our databases. Some of them work, some of them throw a "constraint violation on transactions: link_m29iv801n56pd8oc7tk3q9nn2c"
The requestId is "32375456-2959-9b47-925b-4f8fcbbaac14"
This gotta be something wrong in our code, but I am failing to see what, so we need some support from you to see what's wrong.
22 replies
CDCloudflare Developers
•Created by Eusebio Trigo on 11/5/2023 in #pages-help
Deployments failing using NextJS and next-on-pages
Hi,
We have been deploying our nextjs application for quite some time, and we have been seeing several errors on building that we cannot really diagnose:
one is:
And other occurrences are out of heap memory limit (and we tried with the NODE_OPTIONS --max-old-space-size of 8192 (even when the console says it only accepts 7GB of mem).
We can build in local, with no issues (yes, we have good hardware...).
Is there a way to at least output some more information in the logs?
Thanks, team!
88 replies
CDCloudflare Developers
•Created by Eusebio Trigo on 11/5/2023 in #workers-help
Changes in the last XX hours
Hi team!
I was checking our workers in the dashboard and some of them were displaying "Last modified 14 hours ago". We didn't deploy or changed any configuration. Is there a way to see what were those changes?
2 replies
Objects with json columns after a summaries request provide properties as strings
Hi team,
We are trying to run a summaries like:
const summary = await xata.db.items.summarize({
columns: ["linkedTable.*"],
summaries: {},
filter: {
"anotherLinkedTable.someProperty": "someValue",
},
});
the result comes as:
we would expect:
And we are getting the results but the objects we get from the linkedTable have their JSON columns coming back as a string.
If we do a xata.db.linkedTable.read(linkedTable.id), we do get an object whose JSON columns are objects, and not a string.
6 replies
Import CSV from UI saves data in `main` branch but not in the selected branch
Hi team,
We are testing the import and export through CSV, and found out that when using the UI the data exported from a branch it is imported directly into the
main
branch, but not in the selected branch.12 replies
Migrations across workspaces
Hi Xata team!
I'd like to know if it would be possible to do DDL migrations between different workspaces. I'll explain: we are aiming to have a different workspaces, one for production, another for development, etc. And each workspace contains databases whose branches are for multi-tenant purposes (one customer has one branch).
I already have some code to update from the
main
database to any other branch in that database (I do what we can see in Xata's UI, but in code, but wanted to know if we can do it across workspaces.
Thanks!!21 replies
CDCloudflare Developers
•Created by Eusebio Trigo on 8/2/2023 in #pages-help
Error building pages Module build failed: UnhandledSchemeError: Reading from "node:crypto"
Hi team,
I´m trying to move my NextJs app from Vercel to Pages and i´m getting several errors when building my application:
Failed to compile.
12:58:58.301 ▲ node:crypto
12:58:58.302 ▲ Module build failed: UnhandledSchemeError: Reading from "node:crypto" is not handled by plugins (Unhandled scheme).
12:58:58.302 ▲ Webpack supports "data:" and "file:" URIs by default.
12:58:58.302 ▲ You may need an additional plugin to handle "node:" URIs.
...
12:58:58.304 ▲ node:fs/promises
12:58:58.305 ▲ Module build failed: UnhandledSchemeError: Reading from "node:fs/promises" is not handled by plugins (Unhandled scheme).
12:58:58.305 ▲ Webpack supports "data:" and "file:" URIs by default.
12:58:58.305 ▲ You may need an additional plugin to handle "node:" URIs.
And several more.
It seems it is related to using formidable (https://github.com/node-formidable/formidable). Is there anything I should change somewhere to make it work?
I use formidable in some functions in the pages/api folder to read the form content.
Thanks!
5 replies
Exploring Migrations
Hi team,
I'm exploring the migrations API so I can update all my branches with the latest schema (using branches in a multi-tenant approach). Some time ago I could use "xataApiClient.migrations.getBranchSchemaHistory" or https://xata.io/docs/api-reference/db/db_branch_name/schema/history#query-schema-history to query all the migrations that were applied to a branch.
Now, i'm getting a 500 error in some branches and the list of changes in other branches. I have several RequestIDs if they come helpful for you.
fbc58bc0-20d1-93f9-85f5-d8dde259cc2f
30629f5c-36d3-9a8f-9230-057503608b5f
They all just come back as:
status: 500,
errors: [
{
message: 'Internal Error (RequestID: 30629f5c-36d3-9a8f-9230-057503608b5f)',
status: 500
}
],
requestId: '30629f5c-36d3-9a8f-9230-057503608b5f',
cause: undefined
From other branches I can output something like:
Database fc2c3fca-d71d-4657-b6d5-53da8d807de0 does not need to be updated
Commit mig_cfscsaplsg2bukjkiiog was applied on 2023-02-24T14:48:11.396059Z
Commit mig_cfeikv6481ilejqfj0ug was applied on 2023-02-03T15:38:36.792671Z
Thanks in advance for your help!8 replies
Deno support for deps.ts
Hi team!
I´m trying Deno, and following one of their best practices, they recommend moving all the dependencies with a url or a npm prefix to a deps.ts file: https://deno.land/[email protected]/examples/manage_dependencies
Given that the "xata codegen" tool generates the client code and builds something like:
Is there a recommended way to handle it, as we should not change generated code...
3 replies