Skip to content
Draft

Debug #207

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packs/vtex/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ export const pickSku = <T extends ProductVTEX | LegacyProductVTEX>(
product: T,
maybeSkuId?: string,
): T["items"][number] => {
const items = product.items ?? [];

const skuId = maybeSkuId ??
findFirstAvailable(product.items)?.itemId ??
product.items[0]?.itemId;
findFirstAvailable(items)?.itemId ??
items[0]?.itemId;

for (const item of product.items) {
for (const item of items) {
if (item.itemId === skuId) {
return item;
}
Expand Down
5 changes: 4 additions & 1 deletion plugins/tailwind/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export const bundle = async ({ to, from }: { to: string; from: string }) => {
toFileUrl(join(Deno.cwd(), "tailwind.config.ts")).href
)
.then((mod) => mod.default)
.catch(() => DEFAULT_OPTIONS);
.catch((error) => {
console.error(error);
return DEFAULT_OPTIONS;
});

const processor = postcss([
// deno-lint-ignore no-explicit-any
Expand Down