Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No typescript module when deploying AgentGPT in newer version Node.js, either in Vercel and Netlify. #1536

Open
6 of 10 tasks
codenamedpkt opened this issue Apr 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@codenamedpkt
Copy link

codenamedpkt commented Apr 27, 2024

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

Deploy successful and pages appear.

Current behaviour

It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Steps to reproduce

npm i -g && npm up -g && npm audit fix --force && npm run build ran in console and reproduce errors.

Possible solution

Add vercel.json and netlify.toml and make sure all the components are sufficient and in possible latest version. Specifically, make sure typescript metioned in package.json and package-lock.json.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of AgentGPT.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@codenamedpkt codenamedpkt added the bug Something isn't working label Apr 27, 2024
@codenamedpkt
Copy link
Author

Update:

npm i && npm up && npm audit fix --force && npm run build                                                                                                                  ─╯
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0 <19.0.0' },
npm WARN EBADENGINE   current: { node: 'v21.6.2', npm: '10.2.4' }
npm WARN EBADENGINE }

> [email protected] postinstall
> prisma generate

prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
prisma:warn Prisma detected unknown OS "android" and may not work as expected. Defaulting to "linux".

✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/@prisma/client in 284ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()


> [email protected] prepare
> cd .. && husky install next/.husky

husky - Git hooks installed

up to date, audited 1166 packages in 8s

286 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=18.0.0 <19.0.0' },
npm WARN EBADENGINE   current: { node: 'v21.6.2', npm: '10.2.4' }
npm WARN EBADENGINE }
npm WARN deprecated @uiball/[email protected]: This package has been superceded by https://www.npmjs.com/package/ldrs

added 240 packages, removed 105 packages, changed 482 packages, and audited 1301 packages in 38s

310 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm WARN using --force Recommended protections disabled.
npm WARN audit Updating axios to 1.6.8, which is a SemVer major change.
npm WARN audit Updating next-auth to 4.24.7, which is outside your stated dependency range.

added 1 package, changed 2 packages, and audited 1302 packages in 6s

310 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

> [email protected] build
> next build --no-lint

 ⚠ Linting is disabled
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

   Checking validity of types  ..Failed to compile.

./src/components/Input.tsx:39:13
Type error: Argument of type 'false | "" | 0 | 0n | "md:rounded-l-none" | null | undefined' is not assignable to parameter of type 'ClassValue'.
  Type '0n' is not assignable to type 'ClassValue'.

  37 |             "delay-50 h-15 w-full resize-none rounded-xl border-2 border-slate-7 bg-slate-1 p-2 text-sm tracking-wider text-slate-12 outline-none transition-all selection:bg-sky-300 placeholder:text-slate-8 hover:border-sky-200 focus:border-sky-400 sm:h-20 md:text-lg",
  38 |             props.disabled && "cursor-not-allowed",
> 39 |             props.left && "md:rounded-l-none",
     |             ^
  40 |             props.small && "text-sm sm:py-[0]"
  41 |           )}
  42 |           ref={props.inputRef as RefObject<HTMLTextAreaElement>}

We have some issue when using all of latest components in latest NODE.js.

@codenamedpkt
Copy link
Author

codenamedpkt commented Apr 27, 2024

Another Update:

Diagnosis

The build failed during the 'building site' stage with a type error in the file auth/index.ts at line 30.

The specific error is:

Type error: Argument of type ((user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>) | undefined is not assignable to type (user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>.

Solution

To fix this error, you need to ensure that prismaAdapter.createUser is assigned a valid function of type (user: Omit<AdapterUser, "id">) => Awaitable<AdapterUser>. The error indicates that undefined is being assigned instead of a function which causes the type mismatch.

You should review the logic around prismaAdapter.createUser assignment in auth/index.ts to make sure that the correct function is assigned to it during the build process. Fixing this assignment should resolve the type error and allow the build to succeed.

This error occurs in Netlify when using NODE.js 20 latest LTS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant