webdevcody / file-drive Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi
Im newbie at this
Just want to try
When starting to deploy i get this:
[16:46:34.085] Running build in Washington, D.C., USA (East) – iad1 [16:46:34.226] Cloning github.com/6guard/file-drive (Branch: main, Commit: 0e31fcd) [16:46:34.549] Cloning completed: 323.271ms [16:46:34.590] Previous build cache not available [16:46:34.832] Running "vercel build" [16:46:35.356] Vercel CLI 33.6.1 [16:46:36.023] Installing dependencies... [16:46:53.617] [16:46:53.618] added 504 packages in 17s [16:46:53.619] [16:46:53.619] 146 packages are looking for funding [16:46:53.619] run
npm fundfor details [16:46:53.646] Detected Next.js version: 14.1.0 [16:46:53.650] Detected
package-lock.jsongenerated by npm 7+ [16:46:53.652] Running "npm run build" [16:46:54.833] [16:46:54.834] > [email protected] build [16:46:54.834] > next build [16:46:54.834] [16:46:55.446] Attention: Next.js now collects completely anonymous telemetry regarding usage. [16:46:55.447] This information is used to shape Next.js' roadmap and prioritize features. [16:46:55.447] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: [16:46:55.447] https://nextjs.org/telemetry [16:46:55.448] [16:46:55.543] ▲ Next.js 14.1.0 [16:46:55.543] [16:46:55.609] Creating an optimized production build ... [16:47:12.154] <w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (101kiB) impacts deserialization performance (consider using Buffer instead and decode when needed) [16:47:12.525] ⚠ Compiled with warnings [16:47:12.526] [16:47:12.526] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.526] A Node.js API is used (setImmediate at line: 51) which is not supported in the Edge Runtime. [16:47:12.526] Learn more: https://nextjs.org/docs/api-reference/edge-runtime [16:47:12.526] [16:47:12.526] Import trace for requested module: [16:47:12.527] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.528] ./node_modules/scheduler/index.js [16:47:12.528] ./node_modules/react-dom/cjs/react-dom.production.min.js [16:47:12.528] ./node_modules/react-dom/index.js [16:47:12.528] ./node_modules/next/dist/esm/client/script.js [16:47:12.528] ./node_modules/next/dist/esm/shared/lib/router/router.js [16:47:12.528] ./node_modules/next/dist/esm/client/router.js [16:47:12.528] ./node_modules/next/dist/esm/api/router.js [16:47:12.528] ./node_modules/@clerk/nextjs/dist/esm/pages/ClerkProvider.js [16:47:12.528] ./node_modules/@clerk/nextjs/dist/esm/client-boundary/ClerkProvider.js [16:47:12.528] ./node_modules/@clerk/nextjs/dist/esm/components.client.js [16:47:12.528] ./node_modules/@clerk/nextjs/dist/esm/index.js [16:47:12.528] [16:47:12.529] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.529] A Node.js API is used (setImmediate at line: 51) which is not supported in the Edge Runtime. [16:47:12.529] Learn more: https://nextjs.org/docs/api-reference/edge-runtime [16:47:12.529] [16:47:12.529] Import trace for requested module: [16:47:12.529] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.529] ./node_modules/scheduler/index.js [16:47:12.529] ./node_modules/react-dom/cjs/react-dom.production.min.js [16:47:12.529] ./node_modules/react-dom/index.js [16:47:12.529] ./node_modules/next/dist/esm/client/script.js [16:47:12.529] ./node_modules/next/dist/esm/shared/lib/router/router.js [16:47:12.529] ./node_modules/next/dist/esm/client/router.js [16:47:12.529] ./node_modules/next/dist/esm/api/router.js [16:47:12.530] ./node_modules/@clerk/nextjs/dist/esm/pages/ClerkProvider.js [16:47:12.530] ./node_modules/@clerk/nextjs/dist/esm/client-boundary/ClerkProvider.js [16:47:12.531] ./node_modules/@clerk/nextjs/dist/esm/components.client.js [16:47:12.531] ./node_modules/@clerk/nextjs/dist/esm/index.js [16:47:12.531] [16:47:12.531] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.532] A Node.js API is used (MessageChannel at line: 120) which is not supported in the Edge Runtime. [16:47:12.532] Learn more: https://nextjs.org/docs/api-reference/edge-runtime [16:47:12.532] [16:47:12.532] Import trace for requested module: [16:47:12.532] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.532] ./node_modules/scheduler/index.js [16:47:12.540] ./node_modules/react-dom/cjs/react-dom.production.min.js [16:47:12.540] ./node_modules/react-dom/index.js [16:47:12.540] ./node_modules/next/dist/esm/client/script.js [16:47:12.540] ./node_modules/next/dist/esm/shared/lib/router/router.js [16:47:12.540] ./node_modules/next/dist/esm/client/router.js [16:47:12.541] ./node_modules/next/dist/esm/api/router.js [16:47:12.541] ./node_modules/@clerk/nextjs/dist/esm/pages/ClerkProvider.js [16:47:12.541] ./node_modules/@clerk/nextjs/dist/esm/client-boundary/ClerkProvider.js [16:47:12.541] ./node_modules/@clerk/nextjs/dist/esm/components.client.js [16:47:12.541] ./node_modules/@clerk/nextjs/dist/esm/index.js [16:47:12.541] [16:47:12.541] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.542] A Node.js API is used (MessageChannel at line: 121) which is not supported in the Edge Runtime. [16:47:12.542] Learn more: https://nextjs.org/docs/api-reference/edge-runtime [16:47:12.542] [16:47:12.542] Import trace for requested module: [16:47:12.542] ./node_modules/scheduler/cjs/scheduler.production.min.js [16:47:12.542] ./node_modules/scheduler/index.js [16:47:12.542] ./node_modules/react-dom/cjs/react-dom.production.min.js [16:47:12.542] ./node_modules/react-dom/index.js [16:47:12.543] ./node_modules/next/dist/esm/client/script.js [16:47:12.543] ./node_modules/next/dist/esm/shared/lib/router/router.js [16:47:12.543] ./node_modules/next/dist/esm/client/router.js [16:47:12.543] ./node_modules/next/dist/esm/api/router.js [16:47:12.543] ./node_modules/@clerk/nextjs/dist/esm/pages/ClerkProvider.js [16:47:12.543] ./node_modules/@clerk/nextjs/dist/esm/client-boundary/ClerkProvider.js [16:47:12.543] ./node_modules/@clerk/nextjs/dist/esm/components.client.js [16:47:12.543] ./node_modules/@clerk/nextjs/dist/esm/index.js [16:47:12.543] [16:47:12.544] ./node_modules/@clerk/shared/dist/chunk-RSOCGYTF.mjs [16:47:12.544] A Node.js API is used (MessageEvent at line: 27) which is not supported in the Edge Runtime. [16:47:12.544] Learn more: https://nextjs.org/docs/api-reference/edge-runtime [16:47:12.544] [16:47:12.544] Import trace for requested module: [16:47:12.544] ./node_modules/@clerk/shared/dist/chunk-RSOCGYTF.mjs [16:47:12.544] ./node_modules/@clerk/shared/dist/index.mjs [16:47:12.544] ./node_modules/@clerk/clerk-react/dist/esm/components/uiComponents.js [16:47:12.545] ./node_modules/@clerk/clerk-react/dist/esm/components/index.js [16:47:12.545] ./node_modules/@clerk/clerk-react/dist/esm/index.js [16:47:12.545] ./node_modules/@clerk/nextjs/dist/esm/client-boundary/controlComponents.js [16:47:12.545] ./node_modules/@clerk/nextjs/dist/esm/index.js [16:47:12.545] [16:47:22.808] ✓ Compiled successfully [16:47:22.810] Linting and checking validity of types ... [16:47:32.740] Failed to compile. [16:47:32.741] [16:47:32.741] ./src/app/dashboard/_components/file-browser.tsx:143:22 [16:47:32.741] Type error: Type 'ColumnDef<{ _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<"_storage">; userId: Id<"users">; } & { ...; }>[]' is not assignable to type 'ColumnDef<{ isFavorited: boolean; url: string | null; _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<...>; userId: Id<...>; }, unknown>[]'. [16:47:32.742] Type 'ColumnDef<{ _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<"_storage">; userId: Id<"users">; } & { ...; }>' is not assignable to type 'ColumnDef<{ isFavorited: boolean; url: string | null; _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<...>; userId: Id<...>; }, unknown>'. [16:47:32.743] Type 'ColumnDefBase<{ _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<"_storage">; userId: Id<...>; } & { ...; }, unknown> & StringHeaderIdentifier' is not assignable to type 'ColumnDef<{ isFavorited: boolean; url: string | null; _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<...>; userId: Id<...>; }, unknown>'. [16:47:32.744] Type 'ColumnDefBase<{ _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<"_storage">; userId: Id<...>; } & { ...; }, unknown> & StringHeaderIdentifier' is not assignable to type 'AccessorFnColumnDefBase<{ isFavorited: boolean; url: string | null; _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<...>; userId: Id<...>; }, unknown> & IdIdentifier<...>'. [16:47:32.746] Property 'accessorFn' is missing in type 'ColumnDefBase<{ _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<"_storage">; userId: Id<...>; } & { ...; }, unknown> & StringHeaderIdentifier' but required in type 'AccessorFnColumnDefBase<{ isFavorited: boolean; url: string | null; _id: Id<"files">; _creationTime: number; shouldDelete?: boolean | undefined; type: "image" | "csv" | "pdf"; name: string; orgId: string; fileId: Id<...>; userId: Id<...>; }, unknown>'. [16:47:32.747] [16:47:32.747] �[0m �[90m 141 |�[39m �[33m<�[39m�[33m/�[39m�[33mTabsContent�[39m�[33m>�[39m�[0m [16:47:32.747] �[0m �[90m 142 |�[39m �[33m<�[39m�[33mTabsContent�[39m value�[33m=�[39m�[32m"table"�[39m�[33m>�[39m�[0m [16:47:32.747] �[0m�[31m�[1m>�[22m�[39m�[90m 143 |�[39m �[33m<�[39m�[33mDataTable�[39m columns�[33m=�[39m{columns} data�[33m=�[39m{modifiedFiles} �[33m/�[39m�[33m>�[39m�[0m [16:47:32.747] �[0m �[90m |�[39m �[31m�[1m^�[22m�[39m�[0m [16:47:32.747] �[0m �[90m 144 |�[39m �[33m<�[39m�[33m/�[39m�[33mTabsContent�[39m�[33m>�[39m�[0m [16:47:32.747] �[0m �[90m 145 |�[39m �[33m<�[39m�[33m/�[39m�[33mTabs�[39m�[33m>�[39m�[0m [16:47:32.747] �[0m �[90m 146 |�[39m�[0m [16:47:32.801] Error: Command "npm run build" exited with 1 [16:47:33.128]
hasAccessToOrg and getUser are both declared but never read in files.ts and users.ts. It seems there's some logic missing to make this work correctly.
The YT video about orgId authorization is a bit messy/unclear and the code shown in the video doesn't match the repo:
https://www.youtube.com/watch?v=27hMNWcsa-Y&t=3765s
I can upload files to the convex db and see those files under "files" in the Convex DB, but the data table is empty: No files and no users.
Although the files can be uploaded, the toast is shown every time: ConvexError: you do not have access to this org.
The console error is:
[CONVEX M(files:createFile)] [Request ID: 15ff8b3cefe2071a] Server Error
Uncaught ConvexError: you do not have access to this org
at handler (../convex/files.ts:66:4)
I've tried with a "normal" user and an organization user, but this makes no difference. The error persists with both a user with or without and organization.
Everything else is working nicely, but I can't figure out the logic to make this work or fix it. Please fix this issue and update the main or add a branch with this fix @webdevcody
Hi @webdevcody
Firstly, I thank you for your file-drive web app. This is a wonderful product and I am excited about the stacks that are used in this
But when I run it locally, I create an account, then I create a new organization and upload a file, and the console displays that "can't access this org.." although the image uploaded on file store on convex
I hope to get support from you
Thank you very much!
I was doing everything correct and fine , but at the mentioned timestamp , I got error saying that
the below mentioned is the error i was getting :
Argument of type 'FunctionReference<"mutation", "internal", { tokenIdentifier: string; }, null>' is not assignable to parameter of type 'FunctionReference<"action", "internal" | "public">'.
Type '"mutation"' is not assignable to type '"action"'.ts(2345)
(property) users: {
createUser: FunctionReference<"mutation", "internal", {
tokenIdentifier: string;
}, null>;
}
also this error too , at the "internal" :
Argument of type 'FunctionReference<"mutation", "internal", { tokenIdentifier: string; }, null>' is not assignable to parameter of type 'FunctionReference<"action", "internal" | "public">'.
Type '"mutation"' is not assignable to type '"action"'.ts(2345)
(alias) const internal: {
clerk: {
fulfill: FunctionReference<"action", "internal", {
headers: any;
payload: string;
}, WebhookEvent>;
};
users: {
createUser: FunctionReference<"mutation", "internal", {
...;
}, null>;
};
}
import internal
help me to solve this one
Hello @webdevcody ,
I'm getting this error today stating that upstream image response failed and
{"code":"InvalidStoragePath","message":"Invalid storage path: ************* is not a valid UUID string."},
but yesterday it works fine. Is this problem with the Convex or something else.
Got this console log error: Failed to load resource: the server responded with a status of 400 ()
I encountered some problems, regarding the inability to display images normally on the All Files page, and when clicking download, {"code":"InvalidStoragePath","message":"Invalid storage path: "xxxxxxx" is not a valid UUID string."},
When updating user image, check the convex log and it will show
failure.
Mutation
users:updateUser
Maybe the problem lies in the url or the tokenIdentifier?
this is my code
case "user.created":
await ctx.runMutation(internal.users.createUser, {
tokenIdentifier: `https://${process.env.CLERK_HOSTNAME}|${result.data.id}`,
name: `
${result.data.first_name ?? ""}
${result.data.last_name ?? ""}
`,
image: result.data.image_url,
});
break;
case "user.updated":
await ctx.runMutation(internal.users.updateUser, {
tokenIdentifier: `https://${process.env.CLERK_HOSTNAME}|${result.data.id}`,
name: `
${result.data.first_name ?? ""}
${result.data.last_name ?? ""}
`,
image: result.data.image_url,
});
break;
case 'organizationMembership.created':
await ctx.runMutation(internal.users.addOrgIdToUser, {
tokenIdentifier: `https://${process.env.CLERK_HOSTNAME}|${result.data.public_user_data.user_id}`,
orgId: result.data.organization.id,
role: result.data.role === 'org:admin' ? "admin" : "member",
});
break;
case 'organizationMembership.updated':
await ctx.runMutation(internal.users.updateRoleInOrgForUser, {
tokenIdentifier: `https://${process.env.CLERK_HOSTNAME}|${result.data.public_user_data.user_id}`,
orgId: result.data.organization.id,
role: result.data.role === 'org:admin' ? "admin" : "member",
});
break;
export const createUser = internalMutation({
args: { tokenIdentifier: v.string(), name: v.string(), image: v.string() },
async handler(ctx, args) {
await ctx.db.insert("users", {
tokenIdentifier: args.tokenIdentifier,
orgIds: [],
name: args.name,
image: args.image
})
}
})
export const updateUser = internalMutation({
args: { tokenIdentifier: v.string(), name: v.string(), image: v.string() },
async handler(ctx, args) {
const user = await ctx.db
.query("users")
.withIndex("by_tokenIdentifier", (q) =>
q.eq("tokenIdentifier", args.tokenIdentifier)
).first();
if (!user) {
throw new ConvexError("User not found");
}
await ctx.db.patch(user._id, {
name: args.name,
image: args.image
})
}
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.