Closed diegohdez90 closed 2 weeks ago
Hi @diegohdez90, thank you for reporting this issue! The error logs you provided indicate that the amadeus-ts
package is being used on the client
, when it's only supposed to run server-side
.
In the logs, the stack trace shows that amadeus-ts
package is used in /src/app/utils/amadeus.ts
which was imported in /src/app/page.tsx
which is a client component. The package uses node.js
modules, so it wouldn't work on the client.
I have taken a look at your amadeus-next-tracking-flights
repository, and it seems that you are indeed using the package client-side
Please use the package only on the server, either inside an API route
, server component
or using server actions
in next.js.
Also there is a major security risk in your code:
const API_KEY=process.env.NEXT_PUBLIC_API_KEY
const API_SECRET=process.env.NEXT_PUBLIC_API_SECRET
The API_KEY
and API_SECRET
are sensitive credentials and shouldn’t be prefixed with NEXT_PUBLIC_
In the following snippet there is an error log in my deploy to vercel in a NextJS application
NextJS version: 15.0.1