adomaitis
adomaitis
TTCTheo's Typesafe Cult
Created by adomaitis on 8/2/2023 in #questions
NextJS recursively call API route.ts from API route.ts
lmao this was dumb, I can make external function and import them wherever I need. I made a delete.ts file where: deleteElement deletes all related to the element, including stuff from supabase storage. deletePlace deletes the place and its places and its elements, by calling itself and deleteElement. deleteSite does the same.
4 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 3/8/2023 in #questions
Next 13 + NextAuth - Redirect on the server
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
+ serverComponentsExternalPackages: ['bcrypt'],
},
};

module.exports = nextConfig;
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
+ serverComponentsExternalPackages: ['bcrypt'],
},
};

module.exports = nextConfig;
4 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 3/8/2023 in #questions
Next 13 + NextAuth - Redirect on the server
4 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 3/8/2023 in #questions
Next 13 + NextAuth - Redirect on the server
Trying to follow NextAuth documentation:
import getServerSession from "next-auth/next";
import { authOptions } from "@/src/pages/api/auth/[...nextauth]";

export default async function DashboardPage() {
const session = await getServerSession(authOptions);
console.log(session);
return (
<>
<main className=" z-10 flex h-screen w-screen flex-col items-center justify-center">
<h1>we have session</h1>
</main>
</>
);
}
import getServerSession from "next-auth/next";
import { authOptions } from "@/src/pages/api/auth/[...nextauth]";

export default async function DashboardPage() {
const session = await getServerSession(authOptions);
console.log(session);
return (
<>
<main className=" z-10 flex h-screen w-screen flex-col items-center justify-center">
<h1>we have session</h1>
</main>
</>
);
}
error:
error - ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>

Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./src/pages/api/auth/[...nextauth].ts
./app/(app)/dashboard/page.tsx
error - ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>

Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./src/pages/api/auth/[...nextauth].ts
./app/(app)/dashboard/page.tsx
4 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
it worked
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
thx
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
cool
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
trying it
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
oh shit
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
do you mean on the cleanup?
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
function printNumberFive() { console.log(5); } useEffect(() => { scrollRef.current!.addEventListener("scroll", () => { printNumberFive(); }); return () => { scrollRef.current!.removeEventListener("scroll", () => { printNumberFive(); }); }; }, [selectedItem]);
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 2/16/2023 in #questions
useEffect being weir - EventListener
Yeah that is not working also
16 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 1/17/2023 in #questions
Prisma + Planetscale TLS/SLL error
had .env file with the db url and .env.local with an empty db url. somehow the prisma was getting the right one to push and to use prisma studio but not for finding shit in the db
4 replies
TTCTheo's Typesafe Cult
Created by adomaitis on 1/17/2023 in #questions
Prisma + Planetscale TLS/SLL error
nvm solved it
4 replies