payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.59k stars 1.51k forks source link

payload with postgres not working with next.js #5589

Closed Eric-Arz closed 5 months ago

Eric-Arz commented 6 months ago

Link to reproduction

No response

Describe the Bug

We updated (2.8.1 to 2.11.2) and @payloadcms/db-postgres (0.3.1 to 0.7.0) to the latest version and now Next.js (13.5.6) throws an error on every page that uses the payload client:

⨯ ./node_modules/drizzle-kit/index.d.mts
Module parse failed: Unexpected token (1:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export type DbConnection = {
|     driver: "turso";
|     dbCredentials: {

Import trace for requested module:
./node_modules/drizzle-kit/index.d.mts
./node_modules/drizzle-kit/ sync ^.*$
./node_modules/drizzle-kit/payload.js
./node_modules/@payloadcms/db-postgres/dist/connect.js
./node_modules/@payloadcms/db-postgres/dist/index.js
./payload/payload.config.ts
./payload/payloadClient.ts

To Reproduce

Setup a project with Next.js, payload, @payloadcms/db-postgres and @payloadcms/next-payload. Import the client on a page.

Payload Version

2.11.2

Adapters and Plugins

No response

DanRibbens commented 5 months ago

Hey @Eric-Arz, Thanks for reporting this. We stopped supporting next-payload and are moving fully on next with v3. For that reason, this is going to be closed as we can't put resources into supporting this legacy way of doing it.

We are archiving next-payload and you should be able to do everything using the new beta v3. Migration guide and templates will all be updated in the coming weeks.

Let me know if you find anything else, especially issues going forward with the new v3 beta.

Thanks!

github-actions[bot] commented 3 weeks ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.