-
-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: "Multiple passthrough copy files are trying to write to the same output file" #2174
Comments
Interesting. Sample repo at https://github.com/pdehaan/11ty-2174
|
@pdehaan thanks for the confirmation! 👍 |
I have the same issue, in the folder containing images (and only that). No glob whatsoever. The origin commit for this feature was c3c9d7b
The error is the |
I fixed my problem changing the return object from my |
I now have the issue on multiple projects I want to update. Is this a bug/regression, or should I rewrite my |
Adjust files locations and `addPassthroughCopy` calls because of 11ty/eleventy#2174
On the positive side of this "issue", it means I currently copy the same files multiple times, which is not good for build time. I guess Eleventy could warn about it, but not break like currently. |
I'm definitely on "team bug/regression" since this previously worked and seems like a common workflow (where you might have overlapping globs). /cc @zachleat: Not sure if we want to include a fix for this in v1.0.1 (currently canary.3). npm run build
> 11ty-2174@1.0.0 build
> DEBUG=Eleventy:TemplatePassthroughManager eleventy
@11ty/eleventy v1.0.1-canary.3
Eleventy:TemplatePassthroughManager Resetting counts to 0 +0ms
Eleventy:TemplatePassthroughManager TemplatePassthrough copy started. +8ms
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API paths: { 'src/.well-known': true, 'src/**/*.{jpg,svg,png}': true } +0ms
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API normalized paths: [ { inputPath: './src/.well-known', outputPath: true }, { inputPath: './src/**/*.{jpg,svg,png}', outputPath: true } ] +1ms
Eleventy:TemplatePassthroughManager TemplatePassthrough copying from config: { inputPath: './src/.well-known', outputPath: true } +0ms
Eleventy:TemplatePassthroughManager TemplatePassthrough copying from config: { inputPath: './src/**/*.{jpg,svg,png}', outputPath: true } +0ms
Eleventy:TemplatePassthroughManager Copied './src/.well-known' (1 files) +21ms
[11ty] Problem writing Eleventy templates:
[11ty] 1. Having trouble copying (via EleventyPassthroughCopyError)
[11ty] 2. Having trouble copying './src/**/*.{jpg,svg,png}' (via TemplatePassthroughManagerCopyError)
[11ty] 3. Multiple passthrough copy files are trying to write to the same output file (www/.well-known/favicon.png). src/.well-known/favicon.png and src/.well-known/favicon.png (via TemplatePassthroughManagerCopyError)
[11ty] Copied 1 file / Wrote 2 files in 0.03 seconds (v1.0.1-canary.3)
echo $? # 1 But interestingly, despite the error-ish looking message and non-zero exit code, it seemed to copy the conflicting files. 🤷 tree -a www/
www/
├── .well-known/
│ └── favicon.png
├── assets/
│ └── foo.png
├── index.html
└── posts/
├── index.html
└── logo.svg
3 directories, 5 files Unsatisfying workaround: Move the .well-known/ folder outside of the |
@pdehaan I did move some files and change some But it will be more difficult on larger projects. |
Hmm, appreciate y’all filing this—I’m seeing some additional nuance here now. Because we have more than one way to add passthrough copy entries to the build, it seems like it’s somewhat common to have a single The nuance here is that the error message is currently based on output paths only. We need to de-dupe based on both the input and output first, for two reasons:
I’d like to experiment with keeping the error message when two different input paths attempt to copy to the same output path though—I think that’s warranted! |
@zachleat I fully agree. 👍 Same input/output pair could generate a warning, at least in debug mode. |
If there is a case to be made to put this into 1.0 please let me know! |
This was a breaking change from 0.12.1 to 1.0.0, which is allowed when changing the major number, so I guess it's up to you. I made changes to my projects to be able to move to 1.0.1 already. |
…venty#2174. I realised that I was creating the image in the _site/ directory using the `eleventyConfig.addPassthroughCopy("img");` command AND also by referencing it in /_includes/layouts/base.njk template. Calling the same file twice throws the error therefore removing the command from the .eleventy.js file means that it only runs once which sidesteps the error!
Describe the bug
Trying to upgrade from 0.12.1 to 1.0.0, I get an error during build with the TemplatePassthroughManager:
To Reproduce
This project runs on 0.12.1 without issue: https://github.com/nhoizey/nicolas-hoizey.com/
Upgrading Eleventy to 1.0.0 and running the build gives the error above.
.eleventy.js
contains this configuration:Both
'**/*.{jpg,png,gif,svg,kmz,zip,css}'
and'.well-known'
match the same file:src/.well-known/favicon.jpg
.It looks like 1.0 behaves differently than 0.12.1. Either 0.12.1 was copying the file twice, or it first got the list, and removed duplicates before actually copying.
Expected behavior
The build should run as before.
Environment:
The text was updated successfully, but these errors were encountered: