mckaywrigley / ai-code-translator

Use AI to translate code from one language to another.
https://ai-code-translator.vercel.app
3.9k stars 575 forks source link

npm run dev error #27

Open supersaiyan2019 opened 1 year ago

supersaiyan2019 commented 1 year ago

code-translate@0.1.0 dev next dev

/root/ai-code-translator/node_modules/next/dist/cli/next-dev.js:362 showAll: args["--show-all"] ?? false, ^

SyntaxError: Unexpected token '?' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.dev (/root/ai-code-translator/node_modules/next/dist/lib/commands.js:10:30) at Object. (/root/ai-code-translator/node_modules/next/dist/bin/next:141:28) at Module._compile (internal/modules/cjs/loader.js:999:30)

QCTW commented 1 year ago

Also got the following error when provides API key with query

This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component at ../../node_modules/.pnpm/undici@5.11.0/node_modules/undici/lib/fetch/file.js (evalmachine.:5724:19) at require (evalmachine.:14:50) at ../../node_modules/.pnpm/undici@5.11.0/node_modules/undici/lib/fetch/formdata.js (evalmachine.:5881:49) at require (evalmachine.:14:50) at ../../node_modules/.pnpm/undici@5.11.0/node_modules/undici/lib/fetch/body.js (evalmachine.:6094:35) at require (evalmachine.:14:50) at ../../node_modules/.pnpm/undici@5.11.0/node_modules/undici/lib/fetch/response.js (evalmachine.:6510:49) at require (evalmachine.:14:50) at (evalmachine.:11635:30) at requireFn (file:///home/user/ai-code-translator/node_modules/next/dist/compiled/edge-runtime/index.js:1:7079) { name: 'TypeError'

simonecolombani commented 1 year ago

@supersaiyan2019 I had the same problem and I solved it updating Node at the last version