Skip to content

Commit

Permalink
fix: cannot access before initialization error (#147)
Browse files Browse the repository at this point in the history
The components were exported before their dependencies, which caused
vite to throw an error in the starter.

Also removed `typeof config` from Address.tsx, which was a bad
autocompleted import.
  • Loading branch information
benlife5 authored Nov 11, 2024
1 parent a476e39 commit 966065e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./puck/index.ts";
export * from "./editor/index.ts";
export * from "./puck/index.ts";
3 changes: 1 addition & 2 deletions src/components/puck/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { Section, sectionVariants } from "./atoms/section.js";
import "@yext/pages-components/style.css";
import { VariantProps } from "class-variance-authority";
import { config } from "process";
import {
useDocument,
resolveYextEntityField,
Expand All @@ -27,7 +26,7 @@ export type AddressProps = {
};

const addressFields: Fields<AddressProps> = {
address: YextEntityFieldSelector<typeof config, AddressType>({
address: YextEntityFieldSelector<any, AddressType>({
label: "Address",
filter: { types: ["type.address"] },
}),
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./components/index.ts";
export * from "./hooks/index.ts";
export * from "./utils/index.ts";
export * from "./components/index.ts";

0 comments on commit 966065e

Please sign in to comment.