-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Boiler plate app throws React error #2564
Comments
Hi Sam, nice name! I ran into the exact same situation just now. I deleted |
I cannot recreate the problem reported here. I tested on
I'm not sure I understand this. Can you give the commands you used to create the problem? |
I've got the same error and haven't been able to find a solution yet. Steps to reproduce:
|
Hey @samuelkilada @sawden - I was unable to replicate the issue using the reproducible steps you two provided. I really appreciate you guys bringing this to our attention and we will keep our eyes on this. I am going to close this for now, but if you guys can add more info for reproducing, I will definitely take another look. |
What I was trying to say was that it only seems to break when you add a payload config file with some collections. That means when you are using "npx create-payload-app", which automatically adds a config file and some basic collections, it will cause the error to occur. But if you create it from scratch yourself and don't add the config file, it will work initially. But once you add a config file with a collection and run it, it will break. After that point it will remain broken even if you remove the config file. This tells me it is database related somehow because once a boilerplate collection is added it breaks. I appreciate you looking. It sounds like I'm not the only one having this issue. It's very strange indeed but I'm sure we'll get to the bottom of it eventually. I am currently using yarn to get around it. |
@samuelkilada So, I was able to reproduce your issue. It stems from some of our dependencies using older versions of react. Here is an example, @dnd/core is using ^16.8.0. We would need that repo and a few others to update or add peerDependencies to their package.json files. A workaround for now is installing npm packages with the --legacy-peer-deps=true Here is a bit more information about when npm removed this default behavior. This should get you going in the right direction. You could always use Let us know if we can do anything else for ya! |
I appreciate the help. Unfortunately I still get the error. It's now more critical to solve it because I'm trying to deploy to AWS elastic beanstalk and it's not quite as easy to use yarn there. I added the .npmrc file with the given line in it and made sure to deploy that file with my build but it's not seeming to solve the problem. :( |
@samuelkilada super interesting. We will continue to dig here. Just to be sure, you are confident that your Do you have the ability to customize the We'll report back with more shortly in any case! |
I had exactly the same issue. I fixed it by adding |
#2656 was just merged, it should resolve all these dependency conflicts. There's a canary out now for anyone who is able to try it out |
Thanks very much @jacobsfletch. Is there any way I can test with "npx create-payload-app" using 1.8.3-canary.0 specifically? |
You won't be able to instantiate a new project with that version using |
You could also run |
I tried this out by using the npx create command above but then manually switching out the payload version to the one you mentioned. It appears to work. Thank you! |
@jacobsfletch "1.8.3-canary.0" fix the problem. Thank you! |
Just dropping by this thread to say that damn, I am so happy to hear this. Peer dependency conflicts are so annoying. PUMPED to see them resolved! Patch version coming soon! |
This is now resolved and released in |
I just upgraded to React 18.3.0 and got this issue. After downgrading again it was gone. Still no release notes for 18.3.0: https://github.com/facebook/react/blob/main/CHANGELOG.md |
Found the root cause: the React version is not consistent across the Payload packages. https://github.com/search?q=repo%3Apayloadcms%2Fpayload%2018.2.0&type=code For instance richtext-lexical requires 18.2.0 where others accept 18.3.0. With a React update every two years such problems bite you at a later time :( |
I have just run into this issue by updating react to 18.3.1. I'm now downgrading back to 18.2.0 as it seems that's the baseline. |
I am facing the same issue. Anyone found a solution for this? |
This worked for me as well, thanks! Was pulling my hair out. |
This issue has been automatically locked. |
Link to reproduction
https://www.npmjs.com/package/create-payload-app
To Reproduce
NOTE: This appears to only happen with npm. I know yarn is an option, but the Payload site does say that either can be used and I much prefer npm. :)
Running node 18.15.0 on Windows 11:
Server should start up and successfully connect to mongodb.
Describe the Bug
When navigating to localhost:3000/admin, the browser (Edge and Chrome) doesn't render anything and simply throws:
EDIT: as a follow up note, if you create from scratch and don't add any payload config file, it will successfully render the page and you can create an account. This is when simply setting the "dev" script to "nodemon". However, if you update the dev script to "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts nodemon" and reference a config file with collections in it, it breaks. Then, if you switch the command back to "nodemon", it still fails. This tells me that referencing the config file and creating the database collections somehow results in the error (it is a data-driven error).
Payload Version
1.7.2
The text was updated successfully, but these errors were encountered: