cboard-org / cboard-ai-builder

The Cboard AI Builder is an augmentative and alternative communication (AAC) board generator designed to streamline the creation process for speech therapists or caregivers. It aims to reduce the time required to create specific AAC boards and provide a preliminary draft quickly.
https://cboard.io
GNU General Public License v3.0
6 stars 1 forks source link

Start command fails #113

Closed maxicapodacqua closed 3 months ago

maxicapodacqua commented 3 months ago
yarn run v1.22.21
$ next start
   ▲ Next.js 14.0.4
   - Local:        http://localhost:3000

 ⚠ "next start" does not work with "output: standalone" configuration. Use "node .next/standalone/server.js" instead.
 ✓ Ready in 208ms

image

maxicapodacqua commented 3 months ago

Seems like the error started happening with this PR: https://github.com/cboard-org/cboard-ai-builder/pull/93/files

At first I thought it could be related to the change in the next JS config for output to be standalone, but after changing that back I found that the error was still there.

I tried removing the call to a useTranslation hook and that seems to fix the error:

diff --git a/next.config.js b/next.config.js
index 0a18ac4..0c6d19e 100644
--- a/next.config.js
+++ b/next.config.js
@@ -3,7 +3,7 @@ const withNextIntl = require('next-intl/plugin')('./src/intl/i18n.ts');

 /** @type {import('next').NextConfig} */
 const nextConfig = {
-  output: 'standalone',
+  // output: 'standalone',
   images: {
     remotePatterns: [
       {
diff --git a/src/app/[locale]/dashboard/@board/BoardContainer.tsx b/src/app/[locale]/dashboard/@board/BoardContainer.tsx
index 0d76b9d..7232e63 100644
--- a/src/app/[locale]/dashboard/@board/BoardContainer.tsx
+++ b/src/app/[locale]/dashboard/@board/BoardContainer.tsx
@@ -8,14 +8,15 @@ import React, { useState } from 'react';
 import Toolbar from './Toolbar';
 import { moveOrderItem } from './Grid/gridManipulation';
 import { BoardRecord } from './types';
-import { useTranslations } from 'next-intl';
+// import { useTranslations } from 'next-intl';
 import { DEFAULT_COLUMNS_NUMBER, DEFAULT_ROWS_NUMBER } from './constants';
 import Tile from '@/components/Tile';
 import SelectTileMask from '@/components/SelectTileMask';
 import { useBoundStore } from '@/providers/StoreProvider';

 const BoardSection = () => {
-  const message = useTranslations('Board.BoardContainer');
+  // const message = useTranslations('Board.BoardContainer');
+  const message = (str: string) => str;
   const { board, setBoard } = useBoundStore((state) => state);
   const [isEditing, setIsEditing] = useState(false);
   const [selectedTiles, setSelectedTiles] = useState<string[]>([]);
diff --git a/src/app/[locale]/dashboard/@board/InitialContent.tsx b/src/app/[locale]/dashboard/@board/InitialContent.tsx
index a119c8e..878cda1 100644
--- a/src/app/[locale]/dashboard/@board/InitialContent.tsx
+++ b/src/app/[locale]/dashboard/@board/InitialContent.tsx
@@ -6,7 +6,7 @@ import Typography from '@mui/material/Typography';
 import TextField from '@mui/material/TextField';
 import Chip from '@mui/material/Chip';
 import Image from 'next/image';
-import { useTranslations } from 'next-intl';
+// import { useTranslations } from 'next-intl';
 import Button from '@mui/material/Button';
 import styles from './styles';
 import { useBoundStore } from '@/providers/StoreProvider';
@@ -53,7 +53,8 @@ const PromptExamplesTextField = ({ message }: { message: string }) => {
 };

 export default function InitialContent() {
-  const messages = useTranslations('Board.InitialContent');
+  // const messages = useTranslations('Board.InitialContent');
+  const messages = (str: string) => str;
   return (
     <Box sx={{ height: '100%' }}>
       <Box
@@ -88,10 +89,11 @@ export default function InitialContent() {
                 lineHeight: '56px',
               }}
             >
-              {messages.rich('createANewBoard', {
+              createANewBoard
+              {/* {messages.rich('createANewBoard', {
                 br: () => <br />,
                 b: (children) => <b>{children}</b>,
-              })}
+              })} */}
             </Typography>
           </Box>
           <Box

I will keep investigating but I think the PR must been adding a provider for NextINTL without all the props needed by the children components