Closed alienlebarge closed 5 years ago
Hey @alienlebarge I think your npm run debug
needs your config file to be passed in. Use https://www.11ty.io/docs/usage/#--config-to-change-the-config-file-name to do this.
https://github.com/alienlebarge/alienlebargech-v3/blob/master/package.json#L16
should be "debug": "DEBUG=* npx eleventy --config=lib/eleventy.config.js"
Note that --config=lib/eleventy.config.js
uses an equal sign (looks like that might be wrong in a few places in your package.json
@zachleat, thanks for help.
The debug
script is fixed. But I still have problems to deploy on Netlify.
I have no error when serving the website locally but it doesn't work on Netlify.
Here's the error I get on Netlify:
3:10:35 PM: > eleventy --config=lib/eleventy.config.js
3:10:40 PM: Problem writing Eleventy templates: (more in DEBUG output)
3:10:40 PM: > Having trouble rendering njk template ./src/_content/indices/bookmarks.njk (TemplateContentRenderError)
3:10:40 PM: > (unknown path)
3:10:40 PM: Template render error: (/opt/build/repo/src/_includes/item/bookmark.njk)
3:10:40 PM: ReferenceError: URL is not defined (Template render error):
3:10:40 PM: Template render error: (unknown path)
3:10:40 PM: Template render error: (/opt/build/repo/src/_includes/item/bookmark.njk)
3:10:40 PM: ReferenceError: URL is not defined
3:10:40 PM: at Object._prettifyError (/opt/build/repo/node_modules/nunjucks/src/lib.js:36:11)
3:10:40 PM: at /opt/build/repo/node_modules/nunjucks/src/environment.js:567:19
3:10:40 PM: at eval (eval at _compile (/opt/build/repo/node_modules/nunjucks/src/environment.js:637:18), <anonymous>:11:11)
3:10:40 PM: at /opt/build/repo/node_modules/nunjucks/src/environment.js:617:9
3:10:40 PM: at eval (eval at _compile (/opt/build/repo/node_modules/nunjucks/src/environment.js:637:18), <anonymous>:42:12)
3:10:40 PM: at /opt/build/repo/node_modules/nunjucks/src/environment.js:575:11
3:10:40 PM: at Template.root [as rootRenderFunc] (eval at _compile (/opt/build/repo/node_modules/nunjucks/src/environment.js:637:18), <anonymous>:41:3)
3:10:40 PM: at Template.render (/opt/build/repo/node_modules/nunjucks/src/environment.js:556:10)
3:10:40 PM: at eval (eval at _compile (/opt/build/repo/node_modules/nunjucks/src/environment.js:637:18), <anonymous>:41:10)
3:10:40 PM: at fn (/opt/build/repo/node_modules/a-sync-waterfall/index.js:26:24)
3:10:40 PM: Copied 2 items and Processed 0 files in 4.44 seconds
3:10:40 PM: npm
Here is a PR I made to test that: alienlebarge/alienlebargech-v3#5
I found that the problem come from this script: https://github.com/alienlebarge/alienlebargech-v3/blob/fix-config/lib/filters/hostname.js#L8-L12 If I comment it, the deployment work.
Node version wasn't the same locally than on production.
Adding .nvmrc
file with the Node version fixed the problem
Thanks for your help @zachleat š
Hi !
I have a problem which I can't figure out how to solve. Perhaps someone can help me here š¤
Description
When running a
$ npm run dubug
(or$ DEBUG=* npx eleventy
), I get the following error:but when running an standard build
$ eleventy --config lib/eleventy.config.js
, I get no error. This means I can build locally my website but not when pushing on NetlifyAsk
I can't find where the problem come from.
Things I've tried
Change value of
layout
insrc/_content/bookmarks/bookmarks.json
It change the second line of the error message but can't make it workAdditional Info