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

Can not find module '@payloadcms/next/views' or its corresponding type declarations. #9343

Closed
shawqicauses opened this issue Nov 19, 2024 · 5 comments
Assignees

Comments

@shawqicauses
Copy link

Describe the Bug

I tried create-payload-app@beta and it fails in installing dependencies. So, I tried to install Payload and its dependencies my self. But, @payloadcms/next/views does not have view module.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload-3.0-demo/blob/main/src/app/(payload)/admin/%5B%5B...segments%5D%5D/page.tsx

Reproduction Steps

  1. run npx create-payload-app@beta
  2. run npm install --save payload@beta @payloadcms/next@beta @payloadcms/richtext-lexical@beta @payloadcms/payload-cloud@beta @payloadcms/db-mongodb@beta graphql@^16.8.1 --legacy-peer-deps

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Payload v3.0 and Next.JS v15
@shawqicauses shawqicauses added status: needs-triage Possible bug which hasn't been reproduced yet v3 validate-reproduction labels Nov 19, 2024
@PatrikKozak PatrikKozak self-assigned this Nov 19, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 19, 2024
@PatrikKozak
Copy link
Contributor

Hey @shawqicauses - we are officially out of beta and have released payload 3.0!

So when creating a new project, you just need to do npx create-payload-app - no need to append @beta to it anymore.

It'll be on 3.0 out of the box.

Can you try this out and let me know if you're still experiencing issues with your dependencies being installed? Thanks!

I just tested it out and didn't experience any issues - going to close this but if you are still seeing issues, I'll reopen!

@PatrikKozak PatrikKozak reopened this Nov 19, 2024
@github-actions github-actions bot added the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 19, 2024
@akhrarovsaid
Copy link
Contributor

akhrarovsaid commented Nov 19, 2024

Hey @shawqicauses,

Sorry to hear about the troubles you're experiencing! I see a few issues in the project where you're trying to install Payload into and I'd like to list some things that come to mind that could help.

  1. Payload v3 require both Next v15+ and React 19 (where react and react-dom are pinned to these versions)
  2. As Patrik mentioned, installing Payload v3 going forward does not need the @beta tag, since you use npm this should work for you: npx create-payload-app (maybe try with the --legacy-peer-deps flag?)
  3. With the current way your app is scaffolded out, when you install Payload, you will receive invalid html structure errors due to having a top-level root layout that will conflict with Payloads. See the website template to see how you can avoid this.

It may be worth it to test out Payload in a new project using something like the website template as a guide, and then move over the necessary things from your current project since it's a starter anyway. In this way you can get more comfortable with Payload and have a working app.

@PatrikKozak
Copy link
Contributor

@akhrarovsaid Thanks for the additional info here!

@shawqicauses Did you happen to give the above a try?

@shawqicauses
Copy link
Author

@PatrikKozak Yes, you can close this issue.

In my legacy starter template because of React.JS version and other libraries like ShadCN/UI, Payload CMS could not download its packages correctly, I created a new Next.JS application and initialised Payload and it worked just fine. I created another issue for something else did not work as intended but it is closed now. In general, everything is okay now, thanks!

@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 21, 2024
Copy link

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants