Open szabbbbu opened 3 months ago
Can you paste the source file where this happened? It likely contains that string - <OwnerEditPencil tableToEdit={DB_TABLE_NAMES.
If you can paste the entire file exactly as-is, that would be especially helpful
sure, i was in the middle of renaming string literals to enum values when it happened this is a hono/htmx app where the EditPencil component assembles a url
import GetGroupClassNameByCode from "../../../../Databases/DB_OPERATIONS/GetGroupClassNameByCode";
import { DB_TABLE_NAMES, GC_COL_NAMES } from "../../../../Databases/Types/ENUMS";
import OwnerEditPencil from "../Icons/OwnerEditPencil.icon";
type Props = {
classCode: string;
engName?: string;
}
export default async function ClassEnglishName({classCode, engName}: Props) {
const findName: {name: string} | null = !engName ?
await GetGroupClassNameByCode(classCode, "en")
:
{
name: engName
};
if (!findName) return <></>
return (
<ul class="flex space-x-4 items-center">
<span class="text-xl ml-4">
{findName.name}
</span>
<OwnerEditPencil tableToEdit={DB_TABLE_NAMES.group_class} columnToEdit={GC_COL_NAMES.EnglishName} id={classCode} />
</ul>
);
}
import { DB_TABLE_NAMES } from "../../../../Databases/Types/ENUMS";
type Props = {
id: string;
tableToEdit: DB_TABLE_NAMES;
columnToEdit: string;
}
/**
*
*
* should be able to get the edit form endpoint for multiple tables and columns
*/
export default function OwnerEditPencil({tableToEdit,columnToEdit,id}: Props) {
const evalUrlForTableAndCol = () => {
switch (tableToEdit) {
case DB_TABLE_NAMES.group_class:
return `gc-controls/editgc/${columnToEdit}`
default:
return '/dsfsavewvews'
}
}
return (
<svg
class={`hover:scale-110 rounded-sm justify-self-end`}
hx-get={`/owner/${evalUrlForTableAndCol()}/${id}`}
hx-swap="outerHTML"
hx-target="closest ul"
width="22"
height="22"
viewBox="0 0 15 15"
>
<path d="M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z" fill="#000" fill-rule="evenodd" clip-rule="evenodd">
</path>
</svg>
)
}
this is the enum file:
export enum DB_TABLE_NAMES { group_class = "group_class", group_class_rsvp = "group_class_rsvp", student = "student", student_registration_session = "student_registration_session", student_session = "student_session", owner = "owner", owner_session = "owner_session", password_reset = "password_reset", trainer = "trainer", trainer_session = "trainer_session" }
//group class editable fields export enum GC_COL_NAMES { TrainerID = "TrainerID", ClassType = "ClassType", MeetingTimes = "meetingtimes", //meta descriptor for ClassDate, MeetingStart, MeetingEnd MeetingRoom = "MeetingRoom", SkillLevel = "SkillLevel", SeatLimit = "SeatLimit", NumReservations = "NumReservations", WaitListLimit = "WaitListLimit", Language = "Language", TrainerEmail = "TrainerEmail", ClassCode = "ClassCode", EnglishName = "EnglishName" }
How can we reproduce the crash?
Segmentation fault happened apparently when bun was parsing enums
Relevant log output
Stack Trace (bun.report)
Bun v1.1.21 (
70ca2b7
) on macos aarch64 [RunCommand]Segmentation fault at address 0x46976000000
array_hash_map.ArrayHashMapUnmanaged
src.js_parser.NewParser_
src.js_parser.NewParser_
src.js_parser.NewParser_
src.js_parser.NewParser_
src.js_parser.Parser._parse__anon_110250
src.cache.JavaScript.parse
src.bundler.Bundler.parseMaybeReturnFileOnlyAllowSharedBuffer__anon_97399