Skip to content

Commit

Permalink
fix: no api url build
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtiti committed Sep 3, 2024
1 parent e65f6b0 commit b7d47e4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/[chain]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { fetchEcosystemData } from '~/utils';
import { ChainDetail } from '~/containers';
import { getConfig } from '~/config';

const { DEFAULT_LANG, SUPPORTED_LANGUAGES } = getConfig();
const { DEFAULT_LANG, SUPPORTED_LANGUAGES, API_URL } = getConfig();

interface ChainProps {
chain: EcosystemChainData;
Expand All @@ -33,6 +33,14 @@ const Chain = ({ chain }: InferGetStaticPropsType<typeof getStaticProps>) => {
};

export const getStaticPaths: GetStaticPaths = async () => {
if (!API_URL) {
console.warn('API URL not set, generating fallback paths.');
return {
paths: [],
fallback: true,
};
}

const ecosystemData = await fetchEcosystemData();
const chains = ecosystemData.zkChains;

Expand Down

0 comments on commit b7d47e4

Please sign in to comment.