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

Inject doesn't always write to file #159

Open
jhulst opened this issue Feb 22, 2017 · 6 comments
Open

Inject doesn't always write to file #159

jhulst opened this issue Feb 22, 2017 · 6 comments
Milestone

Comments

@jhulst
Copy link

jhulst commented Feb 22, 2017

Occasionally I see a case where the inject tasks says it injected the CSS/JS but there is nothing added to the files. Sometimes it works fine for a long time but then it stops working for a bit. Wondering if it could be a race condition.

In all cases, Inject says that has inserted files but they are not written to disk.

@jhulst
Copy link
Author

jhulst commented Feb 22, 2017

I just figured out what the issue is. The inject task calls inject:head and inject:footer in parallel. In my setup, the header and the footer are in the same _layout file so those changes were stomping on one another. For me, the inject task should call its children in series to avoid this. Would you accept a PR to change that for the project so other people can avoid similar issues?

@sondr3
Copy link
Owner

sondr3 commented Feb 26, 2017

Hmm, I haven't really put any thought into this being an issue. Any particular reason for having your JS in the head instead of in the bottom of your page? It's not really something that I mind, I just wanted to shave off a few milliseconds by running them in parallel instead of series, but shoot away. 😃

@ryandeussing
Copy link

I'm using the out-of-the-box setup and am having the exact issue. Inject reports that it has injected, but it has not.

@sondr3
Copy link
Owner

sondr3 commented Mar 24, 2017

Seems like this might be an issue after all, I'm traveling at the moment and don't have access to my computer for a few months so you'll have to change the parallel inject to a serial one yourselves until I can update it.

@ryandeussing
Copy link

I'm pretty sure my issue turned out to be unrelated.

@sondr3
Copy link
Owner

sondr3 commented Mar 25, 2017

Oh, do you have any way of reproducing it? When I come back home I'm looking to revamp the generator to use webpack instead and knowing more of the pain points and errors would be nice.

@sondr3 sondr3 added this to To do in Next version Feb 14, 2018
@sondr3 sondr3 added this to the 2.0 milestone Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Next version
  
To do
Development

No branches or pull requests

3 participants