DEV Community

Discussion on: PageBuilder with ACF Flexible Content - Guide to Gatsby WordPress Starter Advanced with Previews, i18n and more

 
ibjorn profile image
Björn Potgieter

Ah, the Windows path actually makes sense if you look at that error.

Thanks for that link. I see there is bit of a process involved, so I'll have to make time for it a bit later. Have some work to catch up on.

Thanks for your time and effort Henrik. Much appreciated.

Thread Thread
 
ezraihi profile image
Ezra Hockman

I'm experiencing the same issue (I'm on a Mac):

/Users/me/sites/gatsby-starter-wordpress-advanced/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error writing tmp-/new-page/ template: Error: ENOENT: no such file or directory, open '.template-cache/tmp-/new-page/.js'

Were you ever able to get that sorted? Thanks!

Thread Thread
 
ibjorn profile image
Björn Potgieter

Sorry, unfortunately not.

Thread Thread
 
henrikwirth profile image
Henrik Wirth • Edited

Sorry, that I can't help more, but my time will be super limited for the next 1-2 months :/

But from what I can see in your error messages:

Error writing tmp-portfolio/ template: Error: ENOENT: no such file or directory, open 'C:\Users\bjorn\www\blackalscozaV4\.template-cache\tmp-portfolio\.js'
Error writing tmp-/new-page/ template: Error: ENOENT: no such file or directory, open '.template-cache/tmp-/new-page/.js'

It seems to be a path problem. First of all both have a slash or backslash (Windows) in front of the .js So for Björn it seems to be the only problem.

For you Ezra, it seems there is more going on. The path should rather look like this:

writing tmp-new-page/ template: open '.template-cache/tmp-new-page.js'

Maybe this helps to debug my code:

  1. Go to create/utils.js
  2. In Line 53 you find the function createPageWithTemplate
  3. In line 64 add a console output like console.log(page.uri)
  4. See what it outputs

My guess is, that your page.uri has a slash before and/or after. This will lead to problems in this setup. You'd need to make sure it does not include slashes. Actually when I look at it, it might make more sense to use page.slug instead. For that you would need to add it to src/templates/page/data.js.

You would also need to be sure though, that there is no duplication of a slug. Otherwise it will overwrite the template from the duplication.

Thread Thread
 
ibjorn profile image
Björn Potgieter

Thanks Henrik. Have been a bit overloaded. Will get back to this in due time and will check out your suggestions.

Thread Thread
 
turbotobiasdk profile image
Turbo Tobias

Did anyone find a solution to this? I am having the same issue. I'm on a Windows PC:

C:\Users\Tobias\AppData\Roaming\npm\node_modules\gatsby-cli\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
throw ex;
^
Error writing tmp-/ template: Error: ENOENT: no such file or directory, open 'C:\Users\Tobias\Desktop\Gatsby\gatsby-starter-wordpress-advanced.template-cache\tmp-.js'

Thread Thread
 
henrikwirth profile image
Henrik Wirth

Hi guys, I updated the code and tutorial. There were some path issues with the new WPGraphQL version. I tested it now on my Windows PC and it works for me. Checkout the master or part-7 branch and see if it solves your issues now.