Tom-Bonnike / netlify-plugin-inline-source

A Netlify plugin to inline your assets/sources, built on top of the `inline-source` package.
https://www.npmjs.com/package/netlify-plugin-inline-source
MIT License
29 stars 8 forks source link

`ENOENT: no such file or directory, open '/opt/build/repo/public/{{ .ConfirmationURL }}'` #6

Closed ehmicky closed 4 years ago

ehmicky commented 4 years ago

The following error is happening in some builds:

Inlining sources failed.
ENOENT: no such file or directory, open '/opt/build/repo/public/{{ .ConfirmationURL }}' 
    fs.js:458:3 Object.openSync
    fs.js:360:35 Object.readFileSync
    /opt/buildhome/.netlify-build-plugins/node_modules/inline-source/lib/load.js:19:41 
    /opt/buildhome/.netlify-build-plugins/node_modules/inline-source/lib/load.js:12:10 load
    /opt/buildhome/.netlify-build-plugins/node_modules/inline-source/lib/run.js:17:17 
    /opt/buildhome/.netlify-build-plugins/node_modules/inline-source/lib/run.js:14:13 run
    /opt/buildhome/.netlify-build-plugins/node_modules/inline-source/index.js:44:15 
    internal/process/task_queues.js:97:5 processTicksAndRejections

The repository is here. The build logs do not show any additional information unfortunately. Do you know what the error might be?

Tom-Bonnike commented 4 years ago

Somehow an URL wasn’t properly templated and it tried to load {{ .ConfirmationURL }} as if it was a file. Since the plugin runs on postBuild, the user probably hadn’t set up their build properly in the first place.

It seems like the repo is using yellowcake, which uses this ConfirmationURL in a lot of templates. It is actually a Netlify CMS/Identity thing, not sure why it wouldn’t be templated.

ehmicky commented 4 years ago

Thanks for looking into this. So it looks like this is an user error, right? If so, I think the current error handling logic is proper: catching the error and reporting it as a user error with utils.build.failBuild(). I.e. this issue can be closed?

Tom-Bonnike commented 4 years ago

Yup! Closing.