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

Render tag cannot resolve files #419

Closed
ekwoka opened this issue Oct 25, 2021 · 8 comments
Closed

Render tag cannot resolve files #419

ekwoka opened this issue Oct 25, 2021 · 8 comments

Comments

@ekwoka
Copy link

ekwoka commented Oct 25, 2021

I'm loving the idea and got basic file saving and such working.

But I can't get includes or renders or layouts working at all. Rendering the file resolves the file and renders fine, but if it includes something else it breaks.

Even cloning the demo repo gets the same error:

ENOENT: Failed to lookup "html.liquid" in "./layouts"

And that's the demo repo.

I don't know what else to even mention since the demo repo itself isn't working and I didn't even touch it.

For informations sake:
Using latest macOS
Latest Node
tried both Latest liquidjs and 9.27 (the one the demo repo uses).

@TheSilkky
Copy link

TheSilkky commented Oct 25, 2021

I've had the same issue here on my repo for a little while now. I'm using latest liquidjs and node version.

For context this is the script I use to render the html:

'use strict';
const { resolve } = require('upath');
const { Liquid } = require('liquidjs');
const { readdirSync, writeFileSync } = require('graceful-fs');

const engine = new Liquid({
    extname: '.liquid'
});

function renderHtml() {
    readdirSync(resolve(__dirname, './pages')).forEach(file => {
        engine.renderFile(resolve(__dirname, `./pages/${file}`)).then(html => {
            writeFileSync(resolve(__dirname, `./dist/${file.replace('.liquid', '.html')}`), html);
        });
    });
}

renderHtml();

Looks related to #395.

ENOENT: Failed to lookup "layouts/default" in "."

@ekwoka
Copy link
Author

ekwoka commented Oct 25, 2021

Yes, I had read that issue, but as that was in connection with Eleventy, I wanted to make a new one clarifying that this is with nothing else, just liquidjs.

@ekwoka
Copy link
Author

ekwoka commented Oct 26, 2021

@TheSilkky It seems 9.27.0 doesn't do this and works fine for me. That's the only version that has renderfiletonodestream and can resolve file paths

@TheSilkky
Copy link

Downgrading to 9.27.0 didn't work for me I'm still getting the same error.

@harttle harttle added the bug label Oct 27, 2021
@harttle
Copy link
Owner

harttle commented Oct 27, 2021

I believe it's related to this, will be traced there, closing this issue.

@harttle harttle closed this as completed Oct 27, 2021
harttle added a commit that referenced this issue Oct 27, 2021
github-actions bot pushed a commit that referenced this issue Oct 27, 2021
## [9.28.3](v9.28.2...v9.28.3) (2021-10-27)

### Bug Fixes

* relative root (by default) yields LookupError, fixes [#419](#419), [#424](#424), also related to [#395](#395) ([aebeae9](aebeae9))
@github-actions
Copy link

🎉 This issue has been resolved in version 9.28.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@harttle
Copy link
Owner

harttle commented Oct 27, 2021

@ekwoka Thank you for specifically addressing this issue. Now demo/nodejs works! @TheSilkky if you're still experiencing other issues, feel free to open another issue for that!

@ekwoka
Copy link
Author

ekwoka commented Oct 27, 2021

Fantastic work! Thank you so much!

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

No branches or pull requests

3 participants