azar
azar
Explore posts from servers
TTCTheo's Typesafe Cult
Created by azar on 1/21/2025 in #questions
onUploadComplete and onUploadErorr callback not working
its a react + node project
export const uploadRouter = {
imageUploader: f(
{
image: {
maxFileSize: "4MB",
maxFileCount: 1,
},
},
{
awaitServerData: true,
}
)
.onUploadError(({ error, fileKey }) => {
console.log("upload error", { message: error.message, fileKey });
throw error;
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", file);
console.log("file url", file.url);

return { uploadedBy: "1234" };
}),
} satisfies FileRouter;
export const uploadRouter = {
imageUploader: f(
{
image: {
maxFileSize: "4MB",
maxFileCount: 1,
},
},
{
awaitServerData: true,
}
)
.onUploadError(({ error, fileKey }) => {
console.log("upload error", { message: error.message, fileKey });
throw error;
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", file);
console.log("file url", file.url);

return { uploadedBy: "1234" };
}),
} satisfies FileRouter;
even though the upload is successfull, i dont see any logs from onUploadComplete nor onUploadError . just this

{"message":"Sending presigned URLs to client","logLevel":"INFO","timestamp":"2025-01-21T11:33:35.521Z","annotations":{"presignedUrls":[{"url":"https://sea1.ingest.uploadthing.co

{"message":"Sending presigned URLs to client","logLevel":"INFO","timestamp":"2025-01-21T11:33:35.521Z","annotations":{"presignedUrls":[{"url":"https://sea1.ingest.uploadthing.co
2 replies
CCConvex Community
Created by azar on 3/8/2024 in #support-community
npx convex dev error
getting error in this format
The package [PACKAGE_NAME] wasn't found on the file system but is built
into node. Are you trying to bundle for node? You can use "platform:
'node'" to do that, which will remove this error.
The package [PACKAGE_NAME] wasn't found on the file system but is built
into node. Are you trying to bundle for node? You can use "platform:
'node'" to do that, which will remove this error.
this is my first time using convex, i have looked other related post, but could nt be able to fix it, can you tell me where should i made the changes required ? project link - https://github.com/azr-arch/unishare --verbose logs:
Codegen finished.
Skipping convex\auth.config.ts that contains multiple dots
Preparing convex\auth.ts
Preparing convex\clerk.ts
Preparing convex\file.ts
Preparing convex\http.ts
Skipping convex\README.md
Skipping convex\schema.ts
Skipping convex\tsconfig.json
Preparing convex\users.ts
Skipping convex\_generated\api.d.ts
Skipping convex\_generated\api.js
Skipping convex\_generated\dataModel.d.ts
Skipping convex\_generated\server.d.ts
Skipping convex\_generated\server.js
⠹ Bundling modules for Convex's runtime...
X [ERROR] Could not resolve "fs"

node_modules/next/dist/compiled/gzip-size/index.js:1:2840:
1 │ ...trict";e.exports=require("fs")},781:e=>{"use strict";e...
╵ ~~~~

The package "fs" wasn't found on the file system but is built into
node. Are you trying to bundle for node? You can use "platform:
'node'" to do that, which will remove this error.
Codegen finished.
Skipping convex\auth.config.ts that contains multiple dots
Preparing convex\auth.ts
Preparing convex\clerk.ts
Preparing convex\file.ts
Preparing convex\http.ts
Skipping convex\README.md
Skipping convex\schema.ts
Skipping convex\tsconfig.json
Preparing convex\users.ts
Skipping convex\_generated\api.d.ts
Skipping convex\_generated\api.js
Skipping convex\_generated\dataModel.d.ts
Skipping convex\_generated\server.d.ts
Skipping convex\_generated\server.js
⠹ Bundling modules for Convex's runtime...
X [ERROR] Could not resolve "fs"

node_modules/next/dist/compiled/gzip-size/index.js:1:2840:
1 │ ...trict";e.exports=require("fs")},781:e=>{"use strict";e...
╵ ~~~~

The package "fs" wasn't found on the file system but is built into
node. Are you trying to bundle for node? You can use "platform:
'node'" to do that, which will remove this error.
19 replies