TemplateWriterWriteError - after publishing a new blog post
forgondolin opened this issue · comments
Hello, sorry for bothering again. I made some style changes and published just a test post, with title and small text, but it didn't render in the static page. I tried a yarn build
and that was the result:
Error writing templates: (more in DEBUG output)
Having trouble writing template: dist/index.html
TemplateWriterWriteError
was thrown
Cannot read property 'toLowerCase' of undefined
TypeError
was thrown:
TypeError: Cannot read property 'toLowerCase' of undefined
at processImage (...\eleventy-starter-ghost\node_modules\eleventy-plugin-lazyimages.eleventy.js:150:45)
at ...\eleventy-starter-ghost\node_modules\eleventy-plugin-lazyimages.eleventy.js:198:47
at Array.map ()
at Template.transformMarkup (...\eleventy-starter-ghost\node_modules\eleventy-plugin-lazyimages.eleventy.js:198:32)
at Template.runTransforms (...\eleventy-starter-ghost\node_modules@11ty\eleventy\src\Template.js:369:29)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Template.renderPageEntry (...\eleventy-starter-ghost\node_modules@11ty\eleventy\src\Template.js:609:15)
at async Template.writeMapEntry (...\eleventy-starter-ghost\node_modules@11ty\eleventy\src\Template.js:616:21)
at async Promise.all (index 5)
I also made a new fresh clone of this repo without editing and got the same error.
in the plugin eleventy.js thats the step where the toLowerCase()
is called:
if (!supportedExtensions.includes(fileExt.toLowerCase())) { logMessage(
${fileExt} placeholder not supported: ${imgPath}); return;
Thanks again
Hey there, did you make sure to follow the installation steps? You might need to run yarn
to install dependencies first https://github.com/TryGhost/eleventy-starter-ghost#installing
Hello David, yes I've installed the dependencies. The application was running well until the moment I've made a new post.
I even tried to purge, clean cache, but it didn't work well...
Is this the first post you added other than the default posts? If so it sounds like you haven’t added your api details, and are still using the default details
If by api details you mean:
GHOST_API_URL=
GHOST_CONTENT_API_KEY=5aa02d0ec03d200b3a9032fa18
SITE_URL=http://localhost:8080
Yes, I've made some changes, the only difference is that I'm running Ghost local on port 2563
Ah cool, you'll also need to set the GHOST_API_URL
to the URL of your Ghost site which I guess will be http://localhost:2563
. Plus that site will need to be running at the same time as the eleventy project, so the API is available for Eleventy to pull from it