You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a build and deploy issue, the application runs fine locally.. the problem is when i go to deploy. Please can someone help.. i've tried just about everything. I've replaced my personal details in code snippets with leave.blank.
Problem writing Eleventy templates: Having trouble rendering liquid template ./.netlify/plugins/node_modules/balanced-match/README.md (via TemplateContentRenderError)
terminal build output:
[11ty] Writing _site/.github/ISSUE_TEMPLATE/feature_request/index.html from ./.github/ISSUE_TEMPLATE/feature_request.md (liquid) [11ty] Writing _site/.github/ISSUE_TEMPLATE/i-have-a-question/index.html from ./.github/ISSUE_TEMPLATE/i-have-a-question.md (liquid) [11ty] Writing _site/.github/ISSUE_TEMPLATE/i-m-having-trouble-with-this-template/index.html from ./.github/ISSUE_TEMPLATE/i-m-having-trouble-with-this-template.md (liquid)
Full log output from netlify: 1:23:38 PM: Netlify Build 1:23:38 PM: ──────────────────────────────────────────────────────────────── 1:23:38 PM: 1:23:38 PM: ❯ Version 1:23:38 PM: @netlify/build 29.36.3 1:23:38 PM: 1:23:38 PM: ❯ Flags 1:23:38 PM: baseRelDir: true 1:23:38 PM: buildId: 65f8401384524800085f154a 1:23:38 PM: deployId: 65f8401384524800085f154c 1:23:38 PM: 1:23:38 PM: ❯ Current directory 1:23:38 PM: /opt/build/repo 1:23:38 PM: 1:23:38 PM: ❯ Config file 1:23:38 PM: /opt/build/repo/netlify.toml 1:23:38 PM: 1:23:38 PM: ❯ Context 1:23:38 PM: production 1:23:39 PM: 1:23:39 PM: ❯ Installing plugins 1:23:39 PM: - @netlify/[email protected] 1:23:49 PM: 1:23:49 PM: ❯ Loading plugins 1:23:49 PM: - @netlify/[email protected] from Netlify app 1:23:50 PM: 1:23:50 PM: build.command from netlify.toml 1:23:50 PM: ──────────────────────────────────────────────────────────────── 1:23:50 PM: 1:23:50 PM: $ eleventy 1:23:52 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output) 1:23:52 PM: [11ty] 1. Having trouble rendering liquid template ./.netlify/plugins/node_modules/balanced-match/README.md (via TemplateContentRenderError) 1:23:52 PM: [11ty] 2. unexpected token at "} will match...", file:./.netlify/plugins/node_modules/balanced-match/README.md, line:50, col:130 (via ParseError)
1:23:52 PM: [11ty] 3. unexpected token at "} will match..." (via AssertionError) 1:23:52 PM: [11ty] 1:23:52 PM: [11ty] Original error stack trace: AssertionError: unexpected token at "} will match..."
1:23:52 PM: [11ty] at new AssertionError (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:1201:28)
1:23:52 PM: [11ty] at assert (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:1236:15)
1:23:52 PM: [11ty] at Tokenizer.readFilter (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2245:9)
1:23:52 PM: [11ty] at Tokenizer.readFilters (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2234:31)
1:23:52 PM: [11ty] at new Value (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2788:34)
1:23:52 PM: [11ty] at new Output (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4472:23)
1:23:52 PM: [11ty] at Parser.parseToken (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4541:24)
1:23:52 PM: [11ty] at Parser.parseTokens (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4531:33)
1:23:52 PM: [11ty] at Parser.parse (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4525:21)
1:23:52 PM: [11ty] at Liquid.parse (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4663:28)
1:23:52 PM: [11ty] Copied 24 files / Wrote 0 files in 1.17 seconds (v1.0.2)
1:23:52 PM:
1:23:52 PM: "build.command" failed
1:23:52 PM: ────────────────────────────────────────────────────────────────
1:23:52 PM:
1:23:52 PM: Error message
1:23:52 PM: Command failed with exit code 1: eleventy (https://ntl.fyi/exit-code-1)
1:23:52 PM:
1:23:52 PM: Error location
1:23:52 PM: In build.command from netlify.toml:
1:23:52 PM: eleventy
1:23:52 PM:
1:23:52 PM: Resolved config
1:23:52 PM: build:
1:23:52 PM: command: eleventy
1:23:52 PM: commandOrigin: config
1:23:52 PM: publish: /opt/build/repo/_site
1:23:52 PM: publishOrigin: config
1:23:52 PM: plugins:
1:23:52 PM: - inputs: {}
1:23:52 PM: origin: ui
1:23:52 PM: package: "@netlify/plugin-lighthouse"
1:23:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:23:52 PM: Failing build: Failed to build site
1:23:53 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
1:23:53 PM: Finished processing build request in 1m12.54s`
// Configuration API: use eleventyConfig.addLayoutAlias(from, to) to add
// layout aliases! Say you have a bunch of existing content using
// layout: post. If you don’t want to rewrite all of those values, just map
// post to a new file like this:
// eleventyConfig.addLayoutAlias("post", "layouts/my_new_post_layout.njk");
// merge results into a single list, add a 'group' field
const imageData = JSON.parse(data.toString()).map((img) => {
img["group"] = file;
return img;
});
mergedImages.push(...imageData);
// write the output file containing all the image objects
fs.writeFile(
`${__dirname}/_data/${mergeFile}`,
JSON.stringify(mergedImages, null, 2),
(err) => {
if (err) throw err;
}
);
});
});
// Don't process folders with static assets e.g. images
eleventyConfig.addPassthroughCopy("favicon_data/");
eleventyConfig.addPassthroughCopy("static/img/**/*");
eleventyConfig.addPassthroughCopy("admin");
eleventyConfig.addPassthroughCopy("_includes/assets/");
/* Markdown Plugins */
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
let options = {
html: true,
breaks: true,
linkify: true,
};
let opts = {
permalink: false,
};
// If your site lives in a different subdirectory, change this.
// Leading or trailing slashes are all normalized away, so don’t worry about it.
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
// This is only used for URLs (it does not affect your file structure)
pathPrefix: "/",
markdownTemplateEngine: "liquid",
htmlTemplateEngine: "njk",
dataTemplateEngine: "njk",
dir: {
input: ".",
includes: "_includes",
data: "_data",
output: "_site",
},
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am having a build and deploy issue, the application runs fine locally.. the problem is when i go to deploy. Please can someone help.. i've tried just about everything. I've replaced my personal details in code snippets with leave.blank.
Problem writing Eleventy templates: Having trouble rendering liquid template ./.netlify/plugins/node_modules/balanced-match/README.md (via TemplateContentRenderError)
terminal build output:
[11ty] Writing _site/.github/ISSUE_TEMPLATE/feature_request/index.html from ./.github/ISSUE_TEMPLATE/feature_request.md (liquid) [11ty] Writing _site/.github/ISSUE_TEMPLATE/i-have-a-question/index.html from ./.github/ISSUE_TEMPLATE/i-have-a-question.md (liquid) [11ty] Writing _site/.github/ISSUE_TEMPLATE/i-m-having-trouble-with-this-template/index.html from ./.github/ISSUE_TEMPLATE/i-m-having-trouble-with-this-template.md (liquid)
Full log output from netlify:
1:23:38 PM: Netlify Build 1:23:38 PM: ──────────────────────────────────────────────────────────────── 1:23:38 PM: 1:23:38 PM: ❯ Version 1:23:38 PM: @netlify/build 29.36.3 1:23:38 PM: 1:23:38 PM: ❯ Flags 1:23:38 PM: baseRelDir: true 1:23:38 PM: buildId: 65f8401384524800085f154a 1:23:38 PM: deployId: 65f8401384524800085f154c 1:23:38 PM: 1:23:38 PM: ❯ Current directory 1:23:38 PM: /opt/build/repo 1:23:38 PM: 1:23:38 PM: ❯ Config file 1:23:38 PM: /opt/build/repo/netlify.toml 1:23:38 PM: 1:23:38 PM: ❯ Context 1:23:38 PM: production 1:23:39 PM: 1:23:39 PM: ❯ Installing plugins 1:23:39 PM: - @netlify/[email protected] 1:23:49 PM: 1:23:49 PM: ❯ Loading plugins 1:23:49 PM: - @netlify/[email protected] from Netlify app 1:23:50 PM: 1:23:50 PM: build.command from netlify.toml 1:23:50 PM: ──────────────────────────────────────────────────────────────── 1:23:50 PM: 1:23:50 PM: $ eleventy 1:23:52 PM: [11ty] Problem writing Eleventy templates: (more in DEBUG output) 1:23:52 PM: [11ty] 1. Having trouble rendering liquid template ./.netlify/plugins/node_modules/balanced-match/README.md (via TemplateContentRenderError) 1:23:52 PM: [11ty] 2. unexpected token at "}
will match...", file:./.netlify/plugins/node_modules/balanced-match/README.md, line:50, col:130 (via ParseError)1:23:52 PM: [11ty] 3. unexpected token at "}
will match..." (via AssertionError) 1:23:52 PM: [11ty] 1:23:52 PM: [11ty] Original error stack trace: AssertionError: unexpected token at "}
will match..."1:23:52 PM: [11ty] at new AssertionError (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:1201:28)
1:23:52 PM: [11ty] at assert (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:1236:15)
1:23:52 PM: [11ty] at Tokenizer.readFilter (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2245:9)
1:23:52 PM: [11ty] at Tokenizer.readFilters (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2234:31)
1:23:52 PM: [11ty] at new Value (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:2788:34)
1:23:52 PM: [11ty] at new Output (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4472:23)
1:23:52 PM: [11ty] at Parser.parseToken (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4541:24)
1:23:52 PM: [11ty] at Parser.parseTokens (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4531:33)
1:23:52 PM: [11ty] at Parser.parse (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4525:21)
1:23:52 PM: [11ty] at Liquid.parse (/opt/build/repo/node_modules/liquidjs/dist/liquid.node.cjs.js:4663:28)
1:23:52 PM: [11ty] Copied 24 files / Wrote 0 files in 1.17 seconds (v1.0.2)
1:23:52 PM:
1:23:52 PM: "build.command" failed
1:23:52 PM: ────────────────────────────────────────────────────────────────
1:23:52 PM:
1:23:52 PM: Error message
1:23:52 PM: Command failed with exit code 1: eleventy (https://ntl.fyi/exit-code-1)
1:23:52 PM:
1:23:52 PM: Error location
1:23:52 PM: In build.command from netlify.toml:
1:23:52 PM: eleventy
1:23:52 PM:
1:23:52 PM: Resolved config
1:23:52 PM: build:
1:23:52 PM: command: eleventy
1:23:52 PM: commandOrigin: config
1:23:52 PM: publish: /opt/build/repo/_site
1:23:52 PM: publishOrigin: config
1:23:52 PM: plugins:
1:23:52 PM: - inputs: {}
1:23:52 PM: origin: ui
1:23:52 PM: package: "@netlify/plugin-lighthouse"
1:23:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:23:52 PM: Failing build: Failed to build site
1:23:53 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
1:23:53 PM: Finished processing build request in 1m12.54s`
package.json
{ "name": "portfolio", "version": "1.0.0", "description": "Portfolio template built with Eleventy and Netlify CMS", "scripts": { "start": "npx @11ty/eleventy --serve", "build": "npx @11ty/eleventy" }, "repository": { "type": "git", "url": "https://github.com/darkins/donald-teskey" }, "author": { "name": "Leave Blank", "email": "[email protected]", "url": "https://www.leaveblank.com" }, "license": "MIT", "bugs": { "url": "https://github.com/leave/blank/issues" }, "homepage": "https://github.com/leave/blank", "devDependencies": { "@11ty/eleventy": "^1.0.1", "eleventy-plugin-sharp-respimg": "^1.3.7", "luxon": "^3.0.1", "markdown-it": "^13.0.1", "markdown-it-anchor": "^8.6.4" }, "dependencies": { "@11ty/eleventy-navigation": "^0.3.3", "@aloskutov/eleventy-plugin-external-links": "^1.4.1", "clean-css": "^5.3.1", "eleventy-plugin-vimeo-embed": "^1.3.4", "html-minifier": "^4.0.0", "uglify-js": "^3.16.3" } }
eleventy.js
`const { DateTime } = require("luxon");
const CleanCSS = require("clean-css");
const UglifyJS = require("uglify-js");
const htmlmin = require("html-minifier");
const respimg = require("eleventy-plugin-sharp-respimg");
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const embedVimeo = require("eleventy-plugin-vimeo-embed");
const externalLinks = require("@aloskutov/eleventy-plugin-external-links");
const fs = require("fs");
module.exports = function (eleventyConfig) {
// ignore node_modules
eleventyConfig.ignores.delete("node_modules/**");
eleventyConfig.ignores.add("README.md");
eleventyConfig.ignores.delete("README.md");
//Shortcodes
eleventyConfig.addShortcode("year", () =>
${new Date().getFullYear()}
);eleventyConfig.addPlugin(respimg);
// Eleventy Navigation https://www.11ty.dev/docs/plugins/navigation/
eleventyConfig.addPlugin(eleventyNavigationPlugin);
eleventyConfig.addPlugin(embedVimeo);
eleventyConfig.addPlugin(externalLinks, { url: "https://dtweb.netlify.app" });
// Configuration API: use eleventyConfig.addLayoutAlias(from, to) to add
// layout aliases! Say you have a bunch of existing content using
// layout: post. If you don’t want to rewrite all of those values, just map
// post to a new file like this:
// eleventyConfig.addLayoutAlias("post", "layouts/my_new_post_layout.njk");
// Merge data instead of overriding
// https://www.11ty.dev/docs/data-deep-merge/
eleventyConfig.setDataDeepMerge(true);
// Date formatting (human readable)
eleventyConfig.addFilter("readableDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toFormat("dd LLL yyyy");
});
// Date formatting (machine readable)
eleventyConfig.addFilter("machineDate", (dateObj) => {
return DateTime.fromJSDate(dateObj).toFormat("yyyy-MM-dd");
});
// Minify CSS
eleventyConfig.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});
// Minify JS
eleventyConfig.addFilter("jsmin", function (code) {
let minified = UglifyJS.minify(code);
if (minified.error) {
console.log("UglifyJS error: ", minified.error);
return code;
}
return minified.code;
});
// Minify HTML output
eleventyConfig.addTransform("htmlmin", function (content, outputPath) {
if (outputPath && outputPath.indexOf(".html") > -1) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
});
return minified;
}
return content;
});
// Configure image in a template paired shortcode
eleventyConfig.addPairedShortcode(
"image",
(srcSet, src, alt, sizes = "(min-width: 400px) 33.3vw, 100vw") => {
return
<img srcset="${srcSet}" src="${src}" alt="${alt}" sizes="${sizes}" />
;}
);
// Automate merge json to work.json
const filesToRead = [
"strands",
"mapping",
"haven",
"one",
"weather",
"landscapes",
"ocean",
"nature",
"horizons",
"paris",
];
const mergedImages = [];
const mergeFile = "work.json";
filesToRead.forEach((file) => {
fs.readFile(
${__dirname}/_data/${file}.json
, (err, data) => {if (err) throw err;
});
// Don't process folders with static assets e.g. images
eleventyConfig.addPassthroughCopy("favicon_data/");
eleventyConfig.addPassthroughCopy("static/img/**/*");
eleventyConfig.addPassthroughCopy("admin");
eleventyConfig.addPassthroughCopy("_includes/assets/");
/* Markdown Plugins */
let markdownIt = require("markdown-it");
let markdownItAnchor = require("markdown-it-anchor");
let options = {
html: true,
breaks: true,
linkify: true,
};
let opts = {
permalink: false,
};
eleventyConfig.setLibrary(
"md",
markdownIt(options).use(markdownItAnchor, opts)
);
return {
templateFormats: ["md", "njk", "html", "liquid"],
};
};
`
Beta Was this translation helpful? Give feedback.
All reactions