Skip to content

Commit

Permalink
fix: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet committed Dec 13, 2024
1 parent 4b4c302 commit f148f58
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const mdxComponents = {

// customize how MDX components are rendered - use DSFR components when possible
export function useMDXComponents(components: MDXComponents): MDXComponents {
// @ts-ignore TODO
return {
...mdxComponents,
...components,
Expand Down
28 changes: 14 additions & 14 deletions src/pages/_error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NextErrorComponent, { ErrorProps as NextErrorProps } from "next/error";
import { NextPageContext } from "next";
import * as Sentry from "@sentry/nextjs";
import Sentry from "@sentry/nextjs";
import Error from "next/error";

export type ErrorPageProps = {
Expand All @@ -22,7 +22,7 @@ const MyError = ({
// getInitialProps is not called in case of
// https://github.com/vercel/next.js/issues/8592. As a workaround, we pass
// err via _app.js so it can be captured
Sentry.captureException(err);
// Sentry.captureException(err);
// Flushing is not required in this case as it only happens on the client
}

Expand Down Expand Up @@ -55,24 +55,24 @@ MyError.getInitialProps = async (
// componentDidMount, etc) that was caught by Next.js's React Error
// Boundary. Read more about what types of exceptions are caught by Error
// Boundaries: https://reactjs.org/docs/error-boundaries.html
await Sentry.captureUnderscoreErrorException(props);
if (err) {
Sentry.captureException(err);
// await Sentry.captureUnderscoreErrorException(props);
// if (err) {
// Sentry.captureException(err);

// Flushing before returning is necessary if deploying to Vercel, see
// https://vercel.com/docs/platform/limits#streaming-responses
await Sentry.flush(2000);
// // Flushing before returning is necessary if deploying to Vercel, see
// // https://vercel.com/docs/platform/limits#streaming-responses
// await Sentry.flush(2000);

return errorInitialProps;
}
// return errorInitialProps;
// }

// If this point is reached, getInitialProps was called without any
// information about what the error might be. This is unexpected and may
// indicate a bug introduced in Next.js, so record it in Sentry
Sentry.captureException(
new Error(`_error.js getInitialProps missing data at path: ${asPath}`)
);
await Sentry.flush(2000);
// Sentry.captureException(
// new Error(`_error.js getInitialProps missing data at path: ${asPath}`)
// );
// await Sentry.flush(2000);

return errorInitialProps;
};
Expand Down
16 changes: 10 additions & 6 deletions src/pages/collection/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ function MyDropzone({
children: ReactNode;
onDrop: (arg: File[]) => void;
}) {
const onDropFiles = useCallback((acceptedFiles: File[]) => {
// Do something with the files
onDrop(acceptedFiles);
}, []);
const onDropFiles = useCallback(
(acceptedFiles: File[]) => {
// Do something with the files
onDrop(acceptedFiles);
},
[onDrop]
);
const { getRootProps, getInputProps, isDragActive } = useDropzone({
onDrop: onDropFiles,
noClick: true,
Expand Down Expand Up @@ -74,7 +77,7 @@ export function Chat({
handleInputChange: UseChatHelpers["handleInputChange"];
input: UseChatHelpers["input"];
isLoading: UseChatHelpers["isLoading"];
hintText: string;
hintText?: string;
}) {
return (
<div style={{ width: "100%", marginBottom: 40 }}>
Expand All @@ -89,6 +92,7 @@ export function Chat({
/>
)}
<Markdown
// @ts-ignore TODO
components={mdxComponents}
className="chat-markdown"
remarkPlugins={[remarkGfm]}
Expand Down Expand Up @@ -169,7 +173,7 @@ const CollectionPage: NextPage<{ collectionId: string }> = ({
reloadCollections();
};

const myHandleSubmit = async (event) => {
const myHandleSubmit = async (event: any) => {
event.preventDefault();
// get relevant RAG informations
const searchResults = await getSearch({
Expand Down

0 comments on commit f148f58

Please sign in to comment.