Closed rocc-o closed 2 years ago
See https://github.com/11ty/eleventy/issues/1765
But maybe try deleting your package-lock.json file (or yarn.lock, if you're using that) and possibly delete your ./node_modules/ directory then reinstall all your dependencies to make sure everything is up to date.
But I'm slightly confused. Looks like the error is somehow related to Browser is not downloaded. .. at ChromeLauncher.launch
which I've never seen before, but seems related to puppeteer (and possibly not 11ty since I don't see anything specific-or-related-to puppeteer in the Eleventy package.json file).
Maybe you need to reinstall puppeteer after updating Node/npm versions, which is probably a good idea to reinstall all dependencies. Although I don't know what's happening in your config where it would be trying to launch puppeteer during a build. :shrug:
So, I've uninstalled previous Node version and installed Node v. 16.13.0 (Windows x64), which gives the same error when npx @11ty/eleventy --serve
If I understood correctly:
1) will I have to reinstall puppeteer in my local directory C:\Users\ricca\OneDrive\Documenti\Websites\raw\
like this npm i puppeteer
? (Eleventy is installed locally there)
2) deleting my package-lock.json, really deleting it like this Remove-Item 'C:\Users\ricca\OneDrive\Documenti\Websites\raw\package-lock.json'
2) deleting ./node_modules/ directory, really deleting it like this Remove-Item 'C:\Users\ricca\OneDrive\Documenti\Websites\raw\node_modules'
3) reinstalling the dependencies -- these I see in my package.json?
{
"name": "raw",
"version": "1.0.0",
"description": "",
"main": "service-worker.js",
"dependencies": {
"@11ty/eleventy-plugin-rss": "^1.1.1",
"eleventy-critical-css": "^0.2.4",
"html-minifier": "^4.0.0",
"imagemin": "^8.0.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-webp": "^6.0.0",
"luxon": "^2.0.1"
},
"devDependencies": {
"@11ty/eleventy": "^0.12.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
And then npx @11ty/eleventy --serve
?
Sorry, but I'm terrified of making some irreparable mistake
Meanwhile I installed Eleventy v0.12.1 from scratch with Node v16.13.0 / npm v.8.1.0.
Eleventy created a new package.json, package-lock.json and node_modules directory.
Then I reinstalled the dependencies as in my previous package.json, and copied all the files to build up the site (except the output _site) in this new directory.
I npx @11ty/eleventy --serve
and...
the previous error is gone, but I get this:
Writing _site/feed.xml from ./feed.njk.
Writing _site/search.json from ./static_search.njk.
Writing _site/sitemap.xml from ./sitemap.njk.
Error writing templates: (more in DEBUG output)
> Having trouble writing template: _site/sights/tags/afrofuturism/index.html
`TemplateWriterWriteError` was thrown
> ConfigError: "minify" is not allowed
`Error` was thrown:
Error: ConfigError: "minify" is not allowed
Problem writing Eleventy templates: (more in DEBUG output)
> Having trouble writing template: _site/sights/tags/afrofuturism/index.html
`TemplateWriterWriteError` was thrown
> ConfigError: "minify" is not allowed
`Error` was thrown:
Error: ConfigError: "minify" is not allowed
Copied 151 files / Wrote 0 files in 0.81 seconds (v0.12.1)
Watching…
[Browsersync] Access URLs:
------------------------------------
Local: http://localhost:8080
External: http://192.168.1.8:8080
------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
------------------------------------
[Browsersync] Serving files from:
I thought that Error: ConfigError: "minify" is not allowed
was due "html-minifier": "^4.0.0"
dependency, so I removed from eleventy.js:
// https://www.11ty.dev/docs/config/#transforms-example-minify-html-output
const htmlmin = require("html-minifier");
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
// Eleventy 1.0+: use this.inputPath and this.outputPath instead
if( outputPath && outputPath.endsWith(".html") ) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
});
return minified;
}
return content;
});
but still: Error: ConfigError: "minify" is not allowed
I've never seen a Error: ConfigError: "minify" is not allowed
error before, but yeah, I'd suspect it could be from an html minifier or possibly the imagemin minifying stuff. Hard to tell without seeing the config or testing locally. But it's always possible that slightly different versions of dependencies (or sub-sub-sub dependencies) get installed on an npm install and you might have small issues pop up.
From the logs above, I'd probably check out sights/tags/afrofuturism/index.njk
(or whatever the source file is) and see if anything is calling a "minify" filter or shortcode or something.
Apart from that, slowly comment out all transforms that might be processing files and then maybe slowly remove each plugin to make sure it isn't something like eleventy-critical-css that might be trying to minify critical CSS or something (which I think it possibly might, based on https://github.com/addyosmani/critical).
I still find it very curious that something like that would break just by reinstalling dependencies, unless you reinstalled all dependencies from scratch and some had major version bumps from the last time you installed them. In which case Node is a scary monster and everything can change between major semver version numbers. I've definitely seen my share of modules that switch from A to B between 1.x and 2.x and break all our flows, so we have to refactor or lock to the older 1.x.
Like you said, Peter, is the bloody eleventy-critical-css (https://github.com/gregives/eleventy-critical-css) which had a major bump from my previous installed version 0.2.4 to the current 1.1.0. I have reinstalled everything from scratch except eleventy-critical-css and everything builds correctly, even faster than before, and even the strange issue I had before (see: https://github.com/11ty/eleventy/issues/2065) is gone! Now, I have to find a way to install a critical-css plugin which works fine. Maybe the one from Addy Osmani (he's one of my idols), I had tried once but without success. Or maybe I can find somewhere the old 0.2.4 from Greg Ives. Anyway, the problem is solved. Thanks!
Update: after investigating the changelog of eleventy-critical-css from v.0.2.4 to v. 1.1.0 I've found that a "minify" option was removed, and that was causing Error: ConfigError: "minify" is not allowed
since I still had it in my eleventy.js (https://github.com/addyosmani/critical/commit/86aaa4a93c707152b61ff210b378f3af72cf1198). So I updated my eleventy.js and the plugin is working fine now. However, that strange error I was mentioning before (see: #2065) is back! It's clear that there's something in this plugin causing it. But anyway, apart from that, Eleventy is building fine.
I have updated node from v14.16.1 to v17.1.0 and as I
npx @11ty/eleventy --serve
I get the following error. So, I've uninstalled node v17.1.0 and installed again v14.16.1, but I still get the same error. I cannot build my site anymore. Please, do you know how can I solve this?