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

TypeError: Cannot read property 'prev' of undefined #200

Closed
paulrobertlloyd opened this issue Mar 7, 2020 · 3 comments
Closed

TypeError: Cannot read property 'prev' of undefined #200

paulrobertlloyd opened this issue Mar 7, 2020 · 3 comments
Labels

Comments

@paulrobertlloyd
Copy link
Contributor

paulrobertlloyd commented Mar 7, 2020

Since the 9.10.0 release, I get this error in 11ty when LiquidJS’s cache option is set to true:

Error writing templates: (more in DEBUG output)
> Having trouble writing template: www/archive/index.html

`TemplateWriterWriteError` was thrown
> Cannot read property 'prev' of undefined, file:src/_layouts/index.liquid, line:1, col:1

`RenderError` was thrown
> Cannot read property 'prev' of undefined

`TypeError` was thrown:
    TypeError: Cannot read property 'prev' of undefined
        at LRU.remove (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.cjs.js:281:14)
        at LRU.ensureLimit (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.cjs.js:294:18)
        at LRU.write (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.cjs.js:269:14)
        at Liquid._parseFile (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.cjs.js:2527:23)
        at _parseFile.next (<anonymous>)
        at reduce (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/liquidjs/dist/liquid.cjs.js:2437:25)
        at async TemplateLayout.render (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/TemplateLayout.js:135:25)
        at async Template.renderPageEntry (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Template.js:537:17)
        at async Template.writeMapEntry (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Template.js:556:21)
        at async Promise.all (index 1022)

It doesn’t seem to be one single template causing this issue either; commenting out lines has the error appear against other templates. Any clues why this might be happening?

@harttle harttle added the bug label Mar 9, 2020
harttle pushed a commit that referenced this issue Mar 9, 2020
## [9.11.1](v9.11.0...v9.11.1) (2020-03-09)

### Bug Fixes

* concurrent write on LRU cache ([#200](#200)) ([6de9338](6de9338))
@harttle
Copy link
Owner

harttle commented Mar 9, 2020

I find a similar case as yours and now it passes in [email protected]. Please let me know if that fixes your trouble.

@paulrobertlloyd
Copy link
Contributor Author

@harttle Awesome. Will see if this fix works. Thanks again!

@paulrobertlloyd
Copy link
Contributor Author

Oops, never got back to you on this. Yup, all works, so closing issue.

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

No branches or pull requests

2 participants