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
dragonhunt02 — Yesterday at 23:11
I tried running uro with docker-compose to test something but there are some errors
=> ERROR [nextjs builder 4/7] COPY .env.production .env 0.0s
=> ERROR [nextjs builder 5/7] COPY src/generated/openapi.json ./src/
Lyuma — Yesterday at 23:11
it requires a postgres database running
oh generating the openapi
dragonhunt02 — Yesterday at 23:13
I'm not sure where are the relevant files for that
Lyuma — Yesterday at 23:14
it's a generated file
I wonder if something like npm run dev would generate it
dragonhunt02 — Yesterday at 23:16
ENOENT: no such file or directory, open '/home/uro/package.json'
Lyuma — Yesterday at 23:25
yeah I forget what generates that
looks like it is generated by elixir
iFire — Yesterday at 23:33
i'm not very effective right now to dig through code
maybe when i wake
dragonhunt02 — Yesterday at 23:33
wait does the project use pnpm?
Lyuma — Yesterday at 23:35
yeah pnpm supposedly works better than npm
my understanding is pnpm is a drop in replacement that runs in parallel but I haven't used it with npm
I actually don't know much about the difference
dragonhunt02 — Yesterday at 23:37
well the frontend folder can't run/install without pnpm
Lyuma — Yesterday at 23:38
yeah there are two parts: the elixir backend code (elixir / mix run) and the frontend code (e.g. pnpm run dev)
I'm just struggling to figure out how to generate openapi.json. I see some elixir code in a dependency that might do it
I'm assuming the backend code has the API and it somehow feeds the openapi to the frontend code
Lyuma — Yesterday at 23:51
Oh @dragonhunt02 I found the trick:
cat openapi-ts.config.ts
import { defineConfig } from "@hey-api/openapi-ts";
export default defineConfig({
input: "http://localhost:4000/api/v1",
output: "src/__generated/api",
client: "@hey-api/client-fetch"
});
so in order for the openapi.json to be generated for the frontend, it needs the backend (Elixir) to be running
Which makes for an interesting time with CI, since you can't build one part without deploying the other, at least enough to run a test
dragonhunt02 — Yesterday at 23:59
I see, so it would need a deploy at docker build time to work
Lyuma — Today at 00:00
ideally not
ideally it would be possible to run the elixir server in some sort of test environment maybe even with sqlite
dragonhunt02 — Today at 00:00
of course 🙃
Lyuma — Today at 00:00
maybe run some unit tests, then spit out the openapi.json
or we can commit openapi.json .... if onyl I can get far enough to run something that can generate it
Lyuma — Today at 00:23
OMG I feel so stupid @dragonhunt02 The solution was right in front of us the whole time... in none other than the README.md file :Facepalm:
mix openapi.spec.json --spec Uro.OpenAPI.Specification --pretty --vendor-extensions=false ./frontend/src/__generated/openapi.json
Here's what it generated for me.
{
"components": {
"responses": {},
"schemas": {
"EmailAndPassword": {
"properties": {... (96 KB left)
Expand
openapi.json
146 KB
sometimes the answer really is to RTFM. Well I learned some stuff about SELinux and podman while trying to get the container to run
dragonhunt02 — Today at 00:32
huh...but where is it in the readme?
Lyuma — Today at 00:35
oh it wasn't merged into master
Lyuma — Today at 00:44
ok I pushed a merge commit. pull and see if it works better
the README.md got some updates
dragonhunt02 — Today at 00:57
I tested it, there are issues with docker image npm
Lyuma — Today at 01:07
were you able to get elixir working in docker (including openapi)?
dragonhunt02 — Today at 01:10
yes however
I had to set COREPACK_INTEGRITY_KEYS=0 in frontend dockerfile
see https://vercel.com/guides/corepack-errors-github-actions How to Fix “Cannot Find Matching Keyid” Errors or “Corepack/PNPM No...
How to debug and address this corepack issue with GitHub Actions.
How to Fix “Cannot Find Matching Keyid” Errors or “Corepack/PNPM No...
Lyuma — Today at 01:12
I recall I couldn't get plain NPM to work, so let's make sure it's using pnpm for now
dragonhunt02 — Today at 01:13
yeah there are other errors
Lyuma — Today at 01:21
oh also, it's using Caddy to allow both the API server and frontend to be on the same host. (Caddyfile redirects /api/v1 to uro (elixir) and everything else to frontend
but it shouldn't need that necessarily to get the frontend running I would think
dragonhunt02 — Today at 01:28
./src/app/(static)/confirm-email/resend.tsx:27:4
Type error: Type 'UseMutateFunction<void, Error, void, unknown>' is not assignable to type 'MouseEventHandler'.
Types of parameters 'variables' and 'event' are incompatible.
Type 'MouseEvent<HTMLElement, MouseEvent>' is not assignable to type 'void'.
25 | disabled={status === "success"}
26 | pending={isPending}
27 | onClick={mutate}
...
ELIFECYCLE Command failed with exit code 1.
It almost compiled
I thought it was gonna work
Lyuma — Today at 01:30
We probably don't need that specific line for now for email verification resend support
If that is the only error you could try removing line 27 there just to see
But if it is just that it is only showing one at a time... might be harder. Could it be a difference in node version or some package compared to what was developed
It would probably be a node or typescript version that would have been used in june or july 2024
dragonhunt02 — Today at 01:37
/src/data/session.ts:1:10
Type error: '"~/api"' has no exported member named 'session'. Did you mean 'Session'?
indeed api.ts has no session strings
if it is provided by an external dependency, that could be a package problem
dragonhunt02 — Today at 02:18
anyway I managed to boot the backend only by editing docker compose file
also, frontend boots from folder with pnpm, but not in docker
maybe it's a problem with alpine base image, that's my guess
Describe the proposed option and how it helps to overcome the problem or limitation
To be determined.
The text was updated successfully, but these errors were encountered:
Context and Problem Statement
dragonhunt02 — Yesterday at 23:11
I tried running uro with docker-compose to test something but there are some errors
=> ERROR [nextjs builder 4/7] COPY .env.production .env 0.0s
=> ERROR [nextjs builder 5/7] COPY src/generated/openapi.json ./src/
Lyuma — Yesterday at 23:11
it requires a postgres database running
oh generating the openapi
dragonhunt02 — Yesterday at 23:13
I'm not sure where are the relevant files for that
Lyuma — Yesterday at 23:14
it's a generated file
I wonder if something like npm run dev would generate it
dragonhunt02 — Yesterday at 23:16
ENOENT: no such file or directory, open '/home/uro/package.json'
Lyuma — Yesterday at 23:25
yeah I forget what generates that
looks like it is generated by elixir
iFire — Yesterday at 23:33
i'm not very effective right now to dig through code
maybe when i wake
dragonhunt02 — Yesterday at 23:33
wait does the project use pnpm?
Lyuma — Yesterday at 23:35
yeah pnpm supposedly works better than npm
my understanding is pnpm is a drop in replacement that runs in parallel but I haven't used it with npm
I actually don't know much about the difference
dragonhunt02 — Yesterday at 23:37
well the frontend folder can't run/install without pnpm
Lyuma — Yesterday at 23:38
yeah there are two parts: the elixir backend code (elixir / mix run) and the frontend code (e.g. pnpm run dev)
I'm just struggling to figure out how to generate openapi.json. I see some elixir code in a dependency that might do it
I'm assuming the backend code has the API and it somehow feeds the openapi to the frontend code
Lyuma — Yesterday at 23:51
Oh @dragonhunt02 I found the trick:
cat openapi-ts.config.ts
import { defineConfig } from "@hey-api/openapi-ts";
export default defineConfig({
input: "http://localhost:4000/api/v1",
output: "src/__generated/api",
client: "@hey-api/client-fetch"
});
so in order for the openapi.json to be generated for the frontend, it needs the backend (Elixir) to be running
Which makes for an interesting time with CI, since you can't build one part without deploying the other, at least enough to run a test
dragonhunt02 — Yesterday at 23:59
I see, so it would need a deploy at docker build time to work
Lyuma — Today at 00:00
ideally not
ideally it would be possible to run the elixir server in some sort of test environment maybe even with sqlite
dragonhunt02 — Today at 00:00
of course 🙃
Lyuma — Today at 00:00
maybe run some unit tests, then spit out the openapi.json
or we can commit openapi.json .... if onyl I can get far enough to run something that can generate it
Lyuma — Today at 00:23
OMG I feel so stupid @dragonhunt02 The solution was right in front of us the whole time... in none other than the README.md file :Facepalm:
mix openapi.spec.json --spec Uro.OpenAPI.Specification --pretty --vendor-extensions=false ./frontend/src/__generated/openapi.json
Here's what it generated for me.
{
"components": {
"responses": {},
"schemas": {
"EmailAndPassword": {
"properties": {... (96 KB left)
Expand
openapi.json
146 KB
sometimes the answer really is to RTFM. Well I learned some stuff about SELinux and podman while trying to get the container to run
dragonhunt02 — Today at 00:32
huh...but where is it in the readme?
Lyuma — Today at 00:35
oh it wasn't merged into master
Lyuma — Today at 00:44
ok I pushed a merge commit. pull and see if it works better
the README.md got some updates
dragonhunt02 — Today at 00:57
I tested it, there are issues with docker image npm
Lyuma — Today at 01:07
were you able to get elixir working in docker (including openapi)?
dragonhunt02 — Today at 01:10
yes however
I had to set COREPACK_INTEGRITY_KEYS=0 in frontend dockerfile
see https://vercel.com/guides/corepack-errors-github-actions
How to Fix “Cannot Find Matching Keyid” Errors or “Corepack/PNPM No...
How to debug and address this corepack issue with GitHub Actions.
How to Fix “Cannot Find Matching Keyid” Errors or “Corepack/PNPM No...
Lyuma — Today at 01:12
I recall I couldn't get plain NPM to work, so let's make sure it's using pnpm for now
dragonhunt02 — Today at 01:13
yeah there are other errors
Lyuma — Today at 01:21
oh also, it's using Caddy to allow both the API server and frontend to be on the same host. (Caddyfile redirects /api/v1 to uro (elixir) and everything else to frontend
but it shouldn't need that necessarily to get the frontend running I would think
dragonhunt02 — Today at 01:28
./src/app/(static)/confirm-email/resend.tsx:27:4
Type error: Type 'UseMutateFunction<void, Error, void, unknown>' is not assignable to type 'MouseEventHandler'.
Types of parameters 'variables' and 'event' are incompatible.
Type 'MouseEvent<HTMLElement, MouseEvent>' is not assignable to type 'void'.
25 | disabled={status === "success"}
26 | pending={isPending}
27 | onClick={mutate}
...
ELIFECYCLE Command failed with exit code 1.
It almost compiled
I thought it was gonna work
Lyuma — Today at 01:30
We probably don't need that specific line for now for email verification resend support
If that is the only error you could try removing line 27 there just to see
But if it is just that it is only showing one at a time... might be harder. Could it be a difference in node version or some package compared to what was developed
It would probably be a node or typescript version that would have been used in june or july 2024
dragonhunt02 — Today at 01:37
/src/data/session.ts:1:10
Type error: '"~/api"' has no exported member named 'session'. Did you mean 'Session'?
indeed api.ts has no session strings
if it is provided by an external dependency, that could be a package problem
dragonhunt02 — Today at 02:18
anyway I managed to boot the backend only by editing docker compose file
also, frontend boots from folder with pnpm, but not in docker
maybe it's a problem with alpine base image, that's my guess
Describe the proposed option and how it helps to overcome the problem or limitation
To be determined.
The text was updated successfully, but these errors were encountered: