Replies: 4 comments 3 replies
-
We've actually removed the "from scratch" instructions in the latest docs that are yet to be deployed because there's now some complex tsconfig configuration to allow for the best DX. I would recommend running create-payload-app and transfering all relevant files. It sounds like you're running into issues that we've tried to mitigate by having create-payload-app. What issues were you facing when going that route? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delayed response. Initially, I couldn't get the create-payload-app to work. (I selected the blank-js option). This option still doesn't work for me. I've done some troubleshooting on my side since then (and before reading your reply), including trying to get ts-node working in general. I don’t know if what I did matters, but now if I select the "blank" option the create-payload-app creates a working project. Selecting the blank-js option still does not work. Unfortunately, even with a 'working' install, I find the project that is created very difficult to work with. I wanted to use payload because it seemed it would be easy to install into an existing express project I'm working on. That doesn't seem to be the case. The created project rather forcibly imposes some very opinionated (and needless) views as to what my devops workflow/tooling should be. Perhaps it does this to ensure the generated docker-compose file will work, but that too is problematic. Why include a docker-compose file and not the handful of additional lines required to add a mongo server which is also required to run? For that matter, why not docker-ize just mongo but not the payload app? At the very least there are some changes one might want to make here even just for basic 'getting it running'. Unfortunately, the project breaks if one does too much customization on this set of docker assumptions. For example, maybe my project would be well suited to have a couple of custom dockerfiles, and perhaps even some startup scripts to initialize a mongo server etc (and, honestly, lord only knows what else one might include in their project). No problem: I'll just create a /build folder drop some docker files in there with the scripts I need, script out the dockerfiles, tweak the docker-compose, and shazam - we're good to go. Right? No, unfortunately, this will break things in the app-generated project. The project's built-in npm commands call some payload build process that ends up copying a whole bunch of USELESS files into the build directory. I have no idea what else this payload build process might be doing, so I've no idea if I can simply remove it. Fundamentally - I don't need or want a CMS to force me to re-code my devops from the ground up. I use gulp, and I have a different set of docker paths/setups. If and when I need a /dist folder, I will script that. All I need from payload is documentation on how payload interacts with express, and the BARE MINIMUM needed to install payload into an EXISTING project with its own existing set of devop tools, workflows, and resources already wired up. |
Beta Was this translation helpful? Give feedback.
-
Thanks @jmikrut I will try the above to see if I can get it running this weekend perhaps.
I mean that they are useless in the /build directory I created to house dockerfiles. I have no doubt they are needed somewhere, but they are serving no purpose (being useless) in the /build folder. The package ships with default commands that have some sort of assumption relating to /dist folders and docker contexts that ended up putting those files someplace useless. I do need some documentation to describe where to place |
Beta Was this translation helpful? Give feedback.
-
Ok so I went back to try and add payload to an existing project based on the above post. I did the following:
Seperately:In an attempt to work out on my own how to add in the payload build command, I added an npm script to test: When I run This is what I mean by opinionated - why can't I specify where this should go within my project? (My expectation is that it should go to the /views/admin folder since my express server uses ejs middleware, but in anycase - in my project - it certainly shouldn't go in /build.) The stuff this command is creating here (in my build folder) are all just (admin) front end ui stuff (I think). My normal build workflows successfully find and copy such assets from other node_modules vendors over to my express app folder all the time, easily, and I can simply state where they should go ... there's no documentation on how to do that for payload that I can find, and the pre-packaged builder seems to just shoves things into the 'build' folder without any knowledge of how my project is actually structured. So I have at least 2 blockers:
|
Beta Was this translation helpful? Give feedback.
-
I'm hoping someone can help me figure this out. I can't get the 'getting started from scratch' instructions to work.
import
syntax forpayload.config.js
node server.js
errors out unless I settype: module
in thepackage.json
require()
syntax forserver.js
- which will then error outserver.js
to useimport
syntax despite the instructions but then getError [ERR_REQUIRE_ESM]: require()
error innode_modules\payload\dist\config\load.js
which is where I give up.I do want to do this from scratch, but for what it's worth the create-payload-app tool didn't work for me either (constantly failing to find .ts files it didn't generate but still wanted somewhere, and misnaming js files as ts files).
Beta Was this translation helpful? Give feedback.
All reactions