Giter Site home page Giter Site logo

convex-demos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

convex-demos's Issues

Error with Next.js rendering

Next.js is giving an error because UseContext is used with no "use client" in convex node_module
Server Error

Error: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
React
node_modules/convex/dist/esm/react/client.js (281:22)
(rsc)/./node_modules/convex/dist/esm/react/client.js
file:///Users/ga104kin/code/next_project/.next/server/vendor-chunks/convex.js (560:1)

webpack_require
file:///Users/ga104kin/code/next_project/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(rsc)/./node_modules/convex/dist/esm/react/use_queries.js (7:68)
(rsc)/./node_modules/convex/dist/esm/react/use_queries.js
file:///Users/ga104kin/code/next_project/.next/server/vendor-chunks/convex.js (600:1)
webpack_require
file:///Users/ga104kin/code/next_project/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(rsc)/./node_modules/convex/dist/esm/react/use_paginated_query.js (9:73)
(rsc)/./node_modules/convex/dist/esm/react/use_paginated_query.js
file:///Users/ga104kin/code/next_project/.next/server/vendor-chunks/convex.js (590:1)
webpack_require
file:///Users/ga104kin/code/next_project/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(rsc)/./node_modules/convex/dist/esm/react/index.js (20:81)
(rsc)/./node_modules/convex/dist/esm/react/index.js
file:///Users/ga104kin/code/next_project/.next/server/vendor-chunks/convex.js (570:1)
webpack_require
file:///Users/ga104kin/code/next_project/.next/server/webpack-runtime.js (33:42)
eval
webpack-internal:///(rsc)/./app/page.tsx (8:70)
(rsc)/./app/page.tsx
file:///Users/ga104kin/code/next_project/.next/server/app/page.js (211:1)
Function.webpack_require
file:///Users/ga104kin/code/next_project/.next/server/webpack-runtime.js (33:42)
async ek
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:455662)
async eJ
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:459752)
async eY
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:460227)
async eY
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:460358)
async eK
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:463770)
async
file:///Users/ga104kin/code/next_project/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js (11:464248)

TypeError: console.time is not a function

calling console.time errors out when used in the convex backend, example:

export const list = query({
  args: {},
  handler: async (ctx) => {
    console.time("list query time");

    const { tokenIdentifier } = await authGuard(ctx)

    const ideas = await ctx.db.query("ideas")
      .filter((q) => q.eq(q.field("userId"), tokenIdentifier))
      .order("desc")
      .collect();

    console.timeEnd("list query time");

    return ideas
  },
});

Logs:

1/13/2024, 6:53:29 AM
40ms
failure
Query
ideas:list
failure
Uncaught TypeError: console.time is not a function
    at handler (../convex/ideas.ts:106:12)

Error when i enter the device name

Welcome to developing with Convex, let's get you logged in.
? Device name: Apple’s MacBook Pro (2)
Unexpected Error: Error: unable to verify the first certificate

can anyone help me?

why outgoing request timed out?

$ npm run dev

[email protected] dev
npm-run-all dev:init --parallel dev:server dev:client

[email protected] dev:init
convex dev --run init --until-success

Unexpected Error: RPError: outgoing request timed out after 10000ms
ERROR: "dev:init" exited with 1.

Network:
Unexpected Error: RPError: outgoing request timed out after 10000ms
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: connect ETIMEDOUT 34.120.195.249:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
PS D:\ideas\ai-town> ping 34.120.195.249

正在 Ping 34.120.195.249 具有 32 字节的数据:
来自 34.120.195.249 的回复: 字节=32 时间=190ms TTL=108
来自 34.120.195.249 的回复: 字节=32 时间=154ms TTL=108
来自 34.120.195.249 的回复: 字节=32 时间=199ms TTL=108

Clerck and Convex setup in Expo app

Hi, I'm trying to setup Clerk in my Expo app which uses Convex. Followed this doc but I need some help because the app is not coming up. I reached to step 8 and decided to run the app to make sure the wiring is correct.

I have the env variable in auth.config.js for CLERK_JWT_ISSUER_DOMAIN which that exists in both local .env file as well as Convex's Environment Variables in Settings.

I use Expo package instead of react for step 6 from the above doc.
import { ClerkProvider, useAuth } from "@clerk/clerk-expo";
import { ConvexProviderWithClerk } from "convex/react-clerk";

CLERK_PUBLISHABLE_KEY is only in local .env file.

The code is wrapped inside these 2 providers.

<ClerkProvider publishableKey={CLERK_PUBLISHABLE_KEY}>
  <ConvexProviderWithClerk
    client={convex}
    useAuth={useAuth}
  >
      My initial route stuff...
  </ConvexProviderWithClerk>
</ClerkProvider>

The result:

Simulator Screenshot - iPhone 15 Pro Max - 2023-10-16 at 20 39 15

Would appreciate any help. I can provide more code snippets but the doc is pretty straightforward.

defining two tables in schema produces type errors

My schema.ts file

export default defineSchema({
    foo: defineTable({
        foo_property: v.string()
    }),
    bar: defineTable({
        bar_property: v.string()
    })
});

my convex fn

export const createBar = mutation({
    args: {
      bar_property: v.string()
    },
    handler: async (ctx, args) => {
        await ctx.db.insert("bar", {
            bar_property: args.bar_property
        });
    }
});

adding bar_property in insert complains with Object literal may only specify known properties, and 'bar_property' does not exist in type '{ foo_property: string;}'

uploading an image from native app using upload URL fails

I'm using Expo and its ImagePicker lib to select an image to upload.
The library return the uri to the image which is in format of file:///Users/blablabla-lots-of-it/Library/Caches/ImagePicker/F2C150D4-505E-4371-9469-3663B2DA1C9F.jpg.

with that storageId comes back undefined always.

Is uploading via upload URLs not supported for react-native/expo?

Thanks.

Does it support for svelte kit

Is there any support comming up for svelte kit, as I have run into problems, like api is outside of serving allow list, and also did not find a doc which explains svelte kit implementation.

Serving saved images do not work

I have followed the documentation and was able to save/upload images to storage.
I'm also successfully read them from storage and receive a http://... path but unfortunately that is not understood by Image component of ReactNative or Expo, so the images are not rendered.

...
{ imageSrc: await ctx.storage.getUrl(item.photoStorageId) }
...

console.log(imageSrc) 
=> https://graceXXXXXXXXXXXX.cloud/api/storage/XXX0de41-2f6d-XXX-XXXX-d4XXXXXX

Please ignore the Xs

Opening that URL in browser downloads a file with a long path to the image, but it's still not rendering any image.

How do I use this (imageSrc) with React Native Image component?

Thanks.

UserIdentity.tokenIdentifier vs UserIdentity.subject in storeUser function

Here:
https://docs.convex.dev/auth/database-auth

The docs recommend using identity.tokenIdentifier to store the external auth id into our DB.

But it looks like this:

console.log(identity.tokenIdentifier);
logs this:
'https://normal-quagga-15.clerk.accounts.dev|user_2UqFb5XFIur7dYbfl7GuCGoUuRH'

Is the left side really needed?

Why don't we do simply this?

console.log(identity.subject);
logs this:
'user_2UqFb5XFIur7dYbfl7GuCGoUuRH'

I think the user_2UqFb5XFIur7dYbfl7GuCGoUuRH is totally unique and enough, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.