Closed tonyketcham closed 4 years ago
If anyone would like to take a more in-depth look to see if I've done something wrong as far as setting the CMS up for deployment, it's in this repo: https://github.com/tonyketcham/puerh.wtf
Perhaps I need to set up a netlify.toml
file to point towards the CMS? Although I'm not sure where it may be hiding on their end since gridsome build
plops it in dist
just like everything else. My build script on Netlify is just set to gridsome build
as well.
I just downloaded a zip of the deployed site files on Netlify and the cms folder isn't in there at all even though gridsome build
creates it locally.
Hey @tonyketcham,
You can use the debug
option to see what's going on to cause the CMS not to be built, e.g.:
{
use: 'gridsome-plugin-netlify-cms',
options: {
modulePath: `src/cms/index.js`,
configPath: `src/cms/config.yml`,
publicPath: `/cms`,
htmlTitle: `Tea CMS`,
debug: true
},
}
When enabling this and building your repo, I see this:
ERROR in ./src/cms/index.js
Module not found: Error: Can't resolve 'uuid/v4' in '/Users/toby/Code/puerh.wtf/src/cms'
You may want to use this inside src/cms/index.js
:
import {v4 as uuid} from 'uuid';
Hey @tobymarsden, can I buy you a coffee or tea?
You've done it and it was so simple haha
@tonyketcham to be fair debug
is undocumented ;-)
@tobymarsden any way I can help with the documentation? Would love to give back
@tobymarsden I created a PR 😊 #18
I've followed the guide and played around with deployment on Netlify to no avail. When the CMS is working with my custom widgets .js file locally, I'm either a) unable to get the CMS to show up at all in deployment or b) unable to have it recognize my custom widgets.
If I follow the official Gridsome guide, adding an index.html to the cms folder with the config proposed there fails to reference my index.js. Leaving it out and setting those routes in the Gridsome config is the only thing that worked for me in development, however that index.html is successfully auto-generated by Gridsome.
Testing
gridsome build
locally gives this:On deployment, routes like puerh.netlify.app/about work, but puerh.netlify.app/cms gives a 404. I generated a sitemap on the deployed site via Netlify, and it's not registering the cms index.html route at all:
Here's the relevant part of my
gridsome.config.js
:...and my
src
directory:I'm able to access everything w/ my custom widgets & config just fine locally on
gridsome develop
. Also, on Netlify I do have it correctly set to deploy the site fromdist
. The deploy logs show no errors either.Happy to provide any more info to help get this resolved! It may just be a silly overlook on my part haha
FWIW, I did notice that after the build phase, the
cms
folder doesn't pop up until after I refresh the directory in VS Code, whereas everything else auto-pops up when the build phase says it's completed.