Sam Whitmore
Sam Whitmore
CCConvex Community
Created by Sam Whitmore on 7/12/2024 in #support-community
Q: Marking a Path as External
I've just encountered this error message:
✘ [ERROR] Could not resolve "$env/static/public"

src/lib/api/weather.ts:1:39:
1 │ import { PUBLIC_WEATHER_API_KEY } from '$env/static/public';
╵ ~~~~~~~~~~~~~~~~~~~~

You can mark the path "$env/static/public" as external to exclude it from the bundle, which will
remove this error.
⠋ Preparing Convex functions...
✘ [ERROR] Could not resolve "$env/static/public"

src/lib/api/weather.ts:1:39:
1 │ import { PUBLIC_WEATHER_API_KEY } from '$env/static/public';
╵ ~~~~~~~~~~~~~~~~~~~~

You can mark the path "$env/static/public" as external to exclude it from the bundle, which will
remove this error.
✘ [ERROR] Could not resolve "$env/static/public"

src/lib/api/weather.ts:1:39:
1 │ import { PUBLIC_WEATHER_API_KEY } from '$env/static/public';
╵ ~~~~~~~~~~~~~~~~~~~~

You can mark the path "$env/static/public" as external to exclude it from the bundle, which will
remove this error.
⠋ Preparing Convex functions...
✘ [ERROR] Could not resolve "$env/static/public"

src/lib/api/weather.ts:1:39:
1 │ import { PUBLIC_WEATHER_API_KEY } from '$env/static/public';
╵ ~~~~~~~~~~~~~~~~~~~~

You can mark the path "$env/static/public" as external to exclude it from the bundle, which will
remove this error.
From this code:
export const add = mutation({
args: {
quant: v.number(),
qual: v.string(),
user: v.string(),
latitude: v.string(),
longitude: v.string()
},
handler: async (ctx, args) => {
const weather = (await getWeatherInformationFromCoordinates(
args.latitude,
args.longitude
)) as WeatherAPIData;
return await ctx.db.insert('responses', {
user: 'Sam',
quant: args.quant,
qual: args.qual,
latitude: args.latitude,
longitude: args.longitude,
country: weather.location.country,
region: weather.location.region,
datetime: new Date().toJSON(),
isDay: weather.current.is_day,
weather: weather.current.condition.text,
cloudCover_percent: weather.current.cloud,
humidity_percent: weather.current.humidity,
heatIndex_C: weather.current.heatindex_c,
temp_C: weather.current.temp_c,
tempFeelsLike_C: weather.current.feelslike_c
});
}
export const add = mutation({
args: {
quant: v.number(),
qual: v.string(),
user: v.string(),
latitude: v.string(),
longitude: v.string()
},
handler: async (ctx, args) => {
const weather = (await getWeatherInformationFromCoordinates(
args.latitude,
args.longitude
)) as WeatherAPIData;
return await ctx.db.insert('responses', {
user: 'Sam',
quant: args.quant,
qual: args.qual,
latitude: args.latitude,
longitude: args.longitude,
country: weather.location.country,
region: weather.location.region,
datetime: new Date().toJSON(),
isDay: weather.current.is_day,
weather: weather.current.condition.text,
cloudCover_percent: weather.current.cloud,
humidity_percent: weather.current.humidity,
heatIndex_C: weather.current.heatindex_c,
temp_C: weather.current.temp_c,
tempFeelsLike_C: weather.current.feelslike_c
});
}
51 replies
CCConvex Community
Created by Sam Whitmore on 7/11/2024 in #support-community
Convex Auth: Implementation with Svelte(Kit)
I've just started learning SvelteKit and Convex, and recently (yesterday) began implementing an auth solution with Clerk. Today, I've woken up to see that Convex Auth is in beta and I feel like the perfect case study – but all the docs are written for React! I'm wondering if Convex Auth is available to use in SvelteKit and, if so, if someone would kindly walk me through the process! Cheers!
18 replies
CCConvex Community
Created by Sam Whitmore on 7/10/2024 in #support-community
Clerk & Convex Q: Third-Party Cookies Issues with Chrome's New Security Updates...
I'm encountering this issue within my inspect element: Cookies with the SameSite=None; Secure and not Partitioned attributes that operate in cross-site contexts are third-party cookies. In future Chrome versions, reading third-party cookies will be blocked. This behavior protects user data from cross-site tracking. This is a result of my codebase requesting my currently signed-in user's tokenIdentifier from Clerk (an auth provider). Does anybody know how I am meant to refactor my codebase to work around this Chrome update? Cheers!
9 replies
CCConvex Community
Created by Sam Whitmore on 7/8/2024 in #support-community
Svelte: `Property 'responses' does not exist on type '{}'.`
I'm encountering this Property 'responses' does not exist on type '{}'. error as I set up my first Convex DB alongside my first Svelte project. Does anybody know where I may have gone wrong?
6 replies