Comments (5)
(the double error there is from my own code, which makes multiple calls to toImage()
... anyway, hopefully enough there to you to investigate... Ps: ❤️ hyperHTML!)
from hyperhtml.
that's a very interesting issue and while I might be able to somehow fix the error, the logic behind hyperHTML
will always trigger network requests for something that might not exist, which is the temporary attribute placeholder.
I didn't know images would use srcset
offline too, but I also see that after those errors, everything works as expected and the srcset, once replaced properly, works as usual.
Two possible solutions here:
- ignore the error since it's rather a warning but the DOM has no meaning for warnings
- create a list of special attributes to replace with dummy attributes, and once parsed the first time, place attributes back again as non dummy.
To be honest I don't like these solutions, and I might place srcset
under the section caveats describing that the error can be ignored for real-world results or suggesting work arounds.
const srcset = ["foo.png 200w"];
// use this instead
function withSrcset(srcset, alt) {
var img = toImage(alt);
img.srcset = srcset.join(" ");
return img;
}
function toImage(alt) {
return hyperHTML.wire()
`<img
role="button"
alt="${alt}"
width="195" height="80"/>`;
}
from hyperhtml.
on second thoughts, I believe ignoring that error is better than trying to fix it.
Not only Chrome is the only browser bothering about it, it actually forces the browser to ignore it instead of trying to load from the network the placeholder.
I think this might be described as "gotcha" but it'll be a won't fix. What do you think?
from hyperhtml.
FYI https://bugs.chromium.org/p/chromium/issues/detail?id=703588
from hyperhtml.
I've updated the README explaining the issue:
https://github.com/WebReflection/hyperHTML#attributes-resolved-offline-might-show-warnings
I think I'm going to close this as "won't fix" for now, because the issue is a console error but not a real bug for hyperHTML
and the solution is basically not ideal, since the moment I make those two errors disappear is the moent Chrome will try to download something that will cause networks error each time.
I like Chrome for not triggering the network request, compared to what other browsers do without warning about the "bad attribute content", but I don't like Chrome showing two red errors in console, even if the code didn't break, and Chrome did the right thing discarding an invalid network request upfront.
Apologies if not ideal, but I don't have reasonable workarounds for this. 🤷♂️ 🤷♀️
from hyperhtml.
Related Issues (20)
- Booleans render as strings. In conditional rendering this can be unexpected. HOT 3
- crash in domdiff HOT 6
- Form can not have element with id of 'remove' HOT 6
- offsetWidth and offseHeight return 0 HOT 2
- What am I doing wrong? HOT 2
- Numeric input with 'value' attribute in IE11 HOT 7
- Can we use hyperhtml without bundler or any other tooling HOT 4
- Boolean readonly attribute HOT 4
- Weak relation in wire method is not working HOT 4
- "original.cloneNode is not a function" using hyperhtml with basichtml HOT 2
- Only last element renders when reusing HOT 6
- Why so many projects? HOT 4
- Inline styles renders empty HOT 5
- Commuunity? HOT 9
- Is re-executing the render function locally a good practice? HOT 4
- 2.34.x is a breaking change, should be 3.0.x HOT 23
- README, dedicated forum and collective HOT 6
- Reuse Nodes also removed from new place HOT 7
- Time to drop legacy support for IE? HOT 3
- replace istanbul HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperhtml.