diff --git a/package.json b/package.json index cbad647..0a4c901 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dependencies": { "@huggingface/hub": "2.4.0", "hightable": "0.18.1", - "hyperparam": "0.3.6", + "hyperparam": "0.3.7", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index cafec0d..ae3a4d8 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -88,7 +88,10 @@ export default function App() { * Note that the iframe has no access to the parent window's location, so * it might already by in sync, we just don't know. */ - window.parent.postMessage({ queryString: window.location.search }, 'https://huggingface.co') + const huggingfaceOrigin = 'https://huggingface.co' + if (window.parent.origin === huggingfaceOrigin) { + window.parent.postMessage({ queryString: window.location.search }, huggingfaceOrigin) + } return diff --git a/src/lib/huggingfaceSource.ts b/src/lib/huggingfaceSource.ts index 38866e1..f1be649 100644 --- a/src/lib/huggingfaceSource.ts +++ b/src/lib/huggingfaceSource.ts @@ -93,8 +93,7 @@ export function getHuggingFaceSource(sourceId: string, options?: {requestInit?: fetchVersions, } } - } catch (e) { - console.error(e) + } catch { return undefined } } diff --git a/vite.config.ts b/vite.config.ts index d13a862..131cf90 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -17,6 +17,7 @@ export default defineConfig({ } }, optimizeDeps: { + // only for dev, not for build exclude: ["hyperparam"], - }, + } })