This breaks types, and makes api / internal return any?
Hello so i just come across was was breaking api / internal types for convex in my repo:
And i'm curious to learn as of why this would break it?
This works:
This breaks api / internal and make them any
And i'm curious to learn as of why this would break it?
This works:
'use node'
// ...imports
export const createVideo = action({
args: video,
handler: async (ctx, args) => {
// Create video and return the ID
const videoId = await ctx.runMutation(internal.videos.mutations.insert, args)
// Create mux upload
const upload = await client.Video.Uploads.create({
new_asset_settings: {
passthrough: videoId,
playback_policy: 'public',
max_resolution_tier: '1080p',
encoding_tier: 'smart',
mp4_support: 'standard',
},
cors_origin: '*',
})
return upload.url
},
})'use node'
// ...imports
export const createVideo = action({
args: video,
handler: async (ctx, args) => {
// Create video and return the ID
const videoId = await ctx.runMutation(internal.videos.mutations.insert, args)
// Create mux upload
const upload = await client.Video.Uploads.create({
new_asset_settings: {
passthrough: videoId,
playback_policy: 'public',
max_resolution_tier: '1080p',
encoding_tier: 'smart',
mp4_support: 'standard',
},
cors_origin: '*',
})
return upload.url
},
})This breaks api / internal and make them any
'use node'
// ...imports
export const createVideo = action({
args: video,
handler: async (ctx, args) => {
// Create video and return the ID
const videoId = await ctx.runMutation(internal.videos.mutations.insert, args)
// Create mux upload
const upload = await client.Video.Uploads.create({
new_asset_settings: {
passthrough: videoId,
playback_policy: 'public',
max_resolution_tier: '1080p',
encoding_tier: 'smart',
mp4_support: 'standard',
},
cors_origin: '*',
})
return {
videoId,
upload,
}
},
})'use node'
// ...imports
export const createVideo = action({
args: video,
handler: async (ctx, args) => {
// Create video and return the ID
const videoId = await ctx.runMutation(internal.videos.mutations.insert, args)
// Create mux upload
const upload = await client.Video.Uploads.create({
new_asset_settings: {
passthrough: videoId,
playback_policy: 'public',
max_resolution_tier: '1080p',
encoding_tier: 'smart',
mp4_support: 'standard',
},
cors_origin: '*',
})
return {
videoId,
upload,
}
},
})