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

Modifying a layout does not rebuild in watch mode #362

Closed
Tejes opened this Issue Feb 19, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@Tejes
Contributor

Tejes commented Feb 19, 2018

When I run Sculpin with vendor/bin/sculpin generate --watch --server and modify a template in the _layouts directory, a new build is triggered, but the modified content does not make it into the built result. If I abort and rerun Sculpin, everything is correct.

@beryllium

This comment has been minimized.

Member

beryllium commented Feb 19, 2018

That sounds unusual. I'm not sure why it would trigger a new build without actually building from the new template content. I'll see if I can reproduce the issue tonight.

Out of curiosity, is the template you're modifying being directly referenced in the front matter of your content?

Also, does the template being modified extend from a different template file using the Twig extends flag?

(I also am curious which OS and PHP version sculpin is being run on, as that may help with replicating the issue)

@Tejes

This comment has been minimized.

Contributor

Tejes commented Feb 20, 2018

Sorry for the missing details. I have Windows 10 and PHP 7.1.14, running in Git-Bash.
I'm using the develop branch (commit ef2c0a3 exactly) because master and 2.1.1 has some weird dependency issues.
The template is the only one currently, and therefore is referenced directly, no extension involved.

@beryllium

This comment has been minimized.

Member

beryllium commented Feb 21, 2018

OK, so I was able to replicate the issue on Develop - but not on Master. Master seemed to work fine.

This barebones composer.json is able to install Sculpin 2.1.1 (which is pretty close to master):

{
    "require": {
        "sculpin/sculpin": "^2.1",
        "dflydev/embedded-composer": "^1.0@dev"
    }
}

Those two packages need to be interpreted at the same time by composer, or else they will start fighting over which version of symfony/console to install.

I'm hoping to remove the embedded-composer dependency sometime soon, it seems to be quite troublesome due to this conflict.

@beryllium

This comment has been minimized.

Member

beryllium commented Feb 23, 2018

The cause of this appears to be that the develop branch is using Twig V2, which has changed the way templates are cached. I've opened a PR that attempts to fix the issue, but it requires extra eyes just in case I've missed a safer or more future-proof way to fix things.

Thanks for filing the report, by the way. Hoping to get this resolved very soon.

@Tejes

This comment has been minimized.

Contributor

Tejes commented Mar 5, 2018

#363 solved the issue, thanks!

@Tejes Tejes closed this Mar 5, 2018

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