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

Two views loading the same CSS resources results in no style being injected #239

Open
patroza opened this issue Jul 16, 2016 · 2 comments
Open
Labels

Comments

@patroza
Copy link

patroza commented Jul 16, 2016

I'm submitting a bug report

  • Library Version:
    1.0.rc

Please tell us about your environment:

  • Operating System:
    Windows 10
  • Node Version:
    6.3.0
  • NPM Version:
    3.10.3
  • JSPM OR Webpack AND Version
    webpack 2.1.0-beta.17
  • Browser:
    all
  • Language:
    TypeScript 2.0

Current behavior:

When two views request the same resource while loading the app, then the second view seems to assume that the resource has finished loading, and tries to add it (null) to DOM, and sets _alreadyGloballyInjected to true. Resulting in nothing added. (when the first request finishes loading, it first checks _alreadyGloballyInjected, which is true, so it just bails)

finder.html:

<require from="./finder.css"></resource>

finder-results.html

<require from="./finder.css"></resource>

Expected/desired behavior:

I haven't been able to reproduce it yet in a less complex app, probably because the resources load instantly..

  • What is the expected behavior?

The second view should wait for the resource to finish loading before trying to process it. Or it shouldn't try to process it at all, because the first view already is doing that.

My workaround:

css-resource.js:

function beforeCompile(content, resources, instruction) {
    if (this.css === null) return;
@Alexander-Taran
Copy link

does not seem to be the case anymore

https://gist.run/?id=b10cbbd39a47dc577bc1adf9ec75b3de

probably can be closed

@Alexander-Taran
Copy link

@bigopon ^^

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

3 participants