Closed richard-herbert-fullpoint closed 1 year ago
Now using node v14.21.3 (npm v6.14.18)
Eleventy Notes requires Node 16 or higher. Can you try it again with Node 16?
I've never used Cloudflare Pages but its hould be possible via NODE_VERSION
environment variable: https://developers.cloudflare.com/pages/platform/build-configuration/#language-support-and-tools
Thank for the prompt response.
I must have missed that, sorry. I did see a warning originally saying that 11ty needed v14 or above so I did have my NODE_VERSION
set to 14
. I've now set it to 16
and have a different error.
2023-02-18T17:44:01.903055Z Cloning repository...
2023-02-18T17:44:03.118501Z From https://github.com/xxxxxxxxxxxxx
2023-02-18T17:44:03.119116Z * branch d2c3fbe1a432bd6de1b3044c9805a581da6f0b18 -> FETCH_HEAD
2023-02-18T17:44:03.119317Z
2023-02-18T17:44:03.18855Z HEAD is now at d2c3fbe Updated Notes to v0.4.0 and 11ty to v2
2023-02-18T17:44:03.189151Z
2023-02-18T17:44:03.329275Z
2023-02-18T17:44:03.357498Z Success: Finished cloning repository files
2023-02-18T17:44:04.067532Z Installing dependencies
2023-02-18T17:44:04.077965Z Python version set to 2.7
2023-02-18T17:44:07.452505Z Downloading and installing node v16.19.1...
2023-02-18T17:44:07.880981Z Downloading https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x64.tar.xz...
2023-02-18T17:44:08.296777Z Computing checksum with sha256sum
2023-02-18T17:44:08.428142Z Checksums matched!
2023-02-18T17:44:12.783886Z Now using node v16.19.1 (npm v8.19.3)
2023-02-18T17:44:13.192535Z Started restoring cached build plugins
2023-02-18T17:44:13.205414Z Finished restoring cached build plugins
2023-02-18T17:44:13.704435Z Attempting ruby version 2.7.1, read from environment
2023-02-18T17:44:17.208325Z Using ruby version 2.7.1
2023-02-18T17:44:17.560977Z Using PHP version 5.6
2023-02-18T17:44:17.717033Z 5.2 is already installed.
2023-02-18T17:44:17.74657Z Using Swift version 5.2
2023-02-18T17:44:17.747638Z Started restoring cached node modules
2023-02-18T17:44:17.762653Z Finished restoring cached node modules
2023-02-18T17:44:18.264047Z Installing NPM modules using NPM version 8.19.3
2023-02-18T17:44:18.671485Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:18.671805Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:18.671968Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:19.069015Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:19.069459Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:19.070164Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:21.778326Z npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
2023-02-18T17:44:21.827137Z npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
2023-02-18T17:44:28.984244Z
2023-02-18T17:44:28.98456Z added 540 packages, and audited 541 packages in 10s
2023-02-18T17:44:28.984719Z
2023-02-18T17:44:28.984863Z 141 packages are looking for funding
2023-02-18T17:44:28.984984Z run `npm fund` for details
2023-02-18T17:44:28.986438Z
2023-02-18T17:44:28.986792Z found 0 vulnerabilities
2023-02-18T17:44:29.00244Z NPM modules installed
2023-02-18T17:44:29.563756Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:29.564071Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:29.564274Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:29.581906Z Installing Hugo 0.54.0
2023-02-18T17:44:30.440241Z Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
2023-02-18T17:44:30.444204Z Started restoring cached go cache
2023-02-18T17:44:30.463608Z Finished restoring cached go cache
2023-02-18T17:44:30.609951Z go version go1.14.4 linux/amd64
2023-02-18T17:44:30.62408Z go version go1.14.4 linux/amd64
2023-02-18T17:44:30.626882Z Installing missing commands
2023-02-18T17:44:30.627126Z Verify run directory
2023-02-18T17:44:30.627293Z Executing user command: npm run build
2023-02-18T17:44:31.103261Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:31.103566Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:31.103765Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:31.120476Z
2023-02-18T17:44:31.120713Z > eleventy-notes@0.4.0 build
2023-02-18T17:44:31.120848Z > cross-env ELEVENTY_ENV=production npm-run-all clean 11ty:build
2023-02-18T17:44:31.120974Z
2023-02-18T17:44:31.814269Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:31.814577Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:31.814719Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:31.829386Z
2023-02-18T17:44:31.829628Z > eleventy-notes@0.4.0 clean
2023-02-18T17:44:31.830227Z > rimraf dist
2023-02-18T17:44:31.830356Z
2023-02-18T17:44:32.322217Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:32.322549Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:32.32271Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:32.337638Z
2023-02-18T17:44:32.337875Z > eleventy-notes@0.4.0 11ty:build
2023-02-18T17:44:32.338012Z > npm run clean && eleventy
2023-02-18T17:44:32.338126Z
2023-02-18T17:44:32.747397Z npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
2023-02-18T17:44:32.747814Z npm WARN config location in the cache, and they are managed by
2023-02-18T17:44:32.748005Z npm WARN config [`cacache`](http://npm.im/cacache).
2023-02-18T17:44:32.762971Z
2023-02-18T17:44:32.76323Z > eleventy-notes@0.4.0 clean
2023-02-18T17:44:32.763385Z > rimraf dist
2023-02-18T17:44:32.763507Z
2023-02-18T17:44:39.815288Z ✨ CSS: Built 1 bundles in 1822ms!
2023-02-18T17:44:40.990135Z ✨ JS: Built 3 bundles in 2666ms!
2023-02-18T17:44:44.516029Z [11ty] Problem writing Eleventy templates: (more in DEBUG output)
2023-02-18T17:44:44.51631Z [11ty] TemplateLayoutPathResolver directory does not exist for layouts/base.njk: ../.app/_includes (via Error)
2023-02-18T17:44:44.516455Z [11ty]
2023-02-18T17:44:44.516581Z [11ty] Original error stack trace: Error: TemplateLayoutPathResolver directory does not exist for layouts/base.njk: ../.app/_includes
2023-02-18T17:44:44.516697Z [11ty] at TemplateLayoutPathResolver.findFileName (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateLayoutPathResolver.js:101:13)
2023-02-18T17:44:44.516832Z [11ty] at TemplateLayoutPathResolver.init (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateLayoutPathResolver.js:70:28)
2023-02-18T17:44:44.51695Z [11ty] at new TemplateLayoutPathResolver (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateLayoutPathResolver.js:21:10)
2023-02-18T17:44:44.51706Z [11ty] at new TemplateLayout (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateLayout.js:17:20)
2023-02-18T17:44:44.517167Z [11ty] at Function.getTemplate (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateLayout.js:56:20)
2023-02-18T17:44:44.517299Z [11ty] at Template.getLayout (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Template.js:147:27)
2023-02-18T17:44:44.517419Z [11ty] at Template.getData (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/Template.js:376:25)
2023-02-18T17:44:44.51754Z [11ty] at async TemplateMap.add (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateMap.js:65:16)
2023-02-18T17:44:44.517649Z [11ty] at async Promise.all (index 69)
2023-02-18T17:44:44.517754Z [11ty] at async TemplateWriter._createTemplateMap (/opt/buildhome/repo/node_modules/@11ty/eleventy/src/TemplateWriter.js:325:5)
2023-02-18T17:44:44.519393Z [11ty] Wrote 0 files in 7.85 seconds (v2.0.0)
2023-02-18T17:44:45.128477Z ERROR: "11ty:build" exited with 1.
2023-02-18T17:44:45.148166Z Failed: build command exited with code: 1
2023-02-18T17:44:46.144144Z Failed: an internal error occurred
I can reproduce the error. It looks like Cloudflare does some kind of Git sparse-checkout (or limiting the directory access in another way) when configuring the root directory, which makes all notes and the layout path ../.app/_includes
inaccessible to Eleventy.
For now you can fix the build using the following settings:
Property | Value |
---|---|
Build command | npm install --prefix .app && npm run build --prefix .app |
Build output directory | .app/dist/ |
Root Directory | / (default) |
I will keep this issue open and investigate the problem further to see if there is a better solution (and probably add the build settings to the documentation).
Yep, you've cracked it!
Thank you for sticking with the issue and finding a solution.
I do usually use Netlify, it's just for this project I'm having to use Cloudflare Pages.
I'm sure a documentation note should cover it. I'd be happy to raise a PR if that would help?
Looks like the commands mentioned above are the way to go, I couldn't find a better solution. I will add them to the docs but have to fix the "Edit this note" link first, which doesn't work on Cloudflare.
Loving the project!
Has anyone deployed to Cloudflare Pages?
I'm having this issue...