Skip to content
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

Something broke with release 2.0.12 using 11ty #31

Open
awaragi opened this issue Jun 27, 2021 · 4 comments
Open

Something broke with release 2.0.12 using 11ty #31

awaragi opened this issue Jun 27, 2021 · 4 comments

Comments

@awaragi
Copy link

awaragi commented Jun 27, 2021

Hey. Not sure what happened but a yarn upgrade on my existing and currently working 11ty site now is causing errors.

Error with passthrough copy: (more in DEBUG output)
> Having trouble copying './src/images'

`TemplatePassthroughManagerCopyError` was thrown
> Cannot read property 'sort' of undefined

`TypeError` was thrown:
    TypeError: Cannot read property 'sort' of undefined
        at xxx/node_modules/@11ty/eleventy/node_modules/recursive-copy/lib/copy.js:90:8
        at async Promise.all (index 0)
Unhandled rejection in promise ([object Promise]): (more in DEBUG output)
> Having trouble copying

`TemplateWriterWriteError` was thrown
> Having trouble copying './src/images'

`TemplatePassthroughManagerCopyError` was thrown
> Cannot read property 'sort' of undefined

`TypeError` was thrown:
    TypeError: Cannot read property 'sort' of undefined
        at xxx/node_modules/@11ty/eleventy/node_modules/recursive-copy/lib/copy.js:90:8
        at async Promise.all (index 0)

I tried debugging by going step by step in the code and the files are actually copied and only at the following code that it fails with results being undefined

				.then(function(results) {
					return results
						.sort(function (a, b) { return a.index - b.index; })
						.map(function(result) { return result.value; });
				});

The recursive-copy is only used in following code:

    eleventyConfig.addPassthroughCopy({'src/images': 'images'});

For now I am happy with my yarn.lock which ensure that my current build is wokring but eventually hope to be able to do upgrade successfuly.

If you need any details let me know. If I find something in the mean time I will post it here.

@timkendrick
Copy link
Owner

timkendrick commented Jun 27, 2021

Thanks for the excellent bug report, I can only apologise for this - this must have been due to a change I released a few hours ago that changes the order in which output directories are created. I thought the test suite covered all the likely scenarios but apparently not.

For the time being I've released v2.0.13 which reverts the change, so if you upgrade to the latest version that should be working again.

I'll make sure to add some more tests that replicate this issue before touching anything else; I'll leave this issue open though and will make sure to push a pre-release version next time!

@awaragi
Copy link
Author

awaragi commented Jun 27, 2021

Wow. thanks for the excellent response time. I confirm that the 2.0.13 the failure is no longer there. If you ever want me to test out a new version let me know.

@timkendrick
Copy link
Owner

Thanks, I might take you up on that offer for testing a prerelease - I'll also catch up with how 11ty are using this library to make sure that there are no more of these breaking changes in future.

I'll make sure to update this issue once I'm ready to roll out a fix.

@Zearin
Copy link

Zearin commented Apr 13, 2024

Is this still an issue with latest (2.0.14)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants