Giter VIP home page Giter VIP logo

Comments (3)

littlebee avatar littlebee commented on May 30, 2024

I did a bit more debugging on this issue. In Firefox, the base64 encoded 'url' looks quite different on Firefox and Chrome debuggers.
In Chome, the module exports returned from webpack_require(24) =

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABoCAYAAAAHIFUvAAAAGXRFW…dk7GCMERBgUpCgmqJbQEcPxlgBIVDohNbFrwJGR/8XYAA/IBnrVTxJagAAAABJRU5ErkJggg=="

In Firefox, the same method returns a much bigger image src that displays renders in the DOM with the image tag having src=""

Interestingly, I tried setting the Chrome image src to the data above in firebug console and, viola, petals. See attach screenshot and text file for the full firefox base64 data.

I tried to just hard code the chrome value in source code but that didn't work either on firefox.

inspector_-_http___zulily_github_io_react-datum_docs_examples__bigkittens_and_react-datum_and_documents

webpackImageData.txt

from url-loader.

brianchirls avatar brianchirls commented on May 30, 2024

The values are not different in Firefox and Chrome. Chrome's debugger just doesn't show the full dataURI. It puts in that fake ellipsis to keep very long strings from filling up your whole screen.

It looks like this is a problem with your code, not with url-loader or webpack. LazyPhoto is relying on the browser to fire an error event to set notFound, which tells it to use notFoundUrl. But it looks like Firefox doesn't fire that event when you set an empty src on the image - only when you set an actual URL that doesn't get a 200 response from the server. If you just skip that part and go straight to using notFoundUrl when the thumbnailUrl is blank, it should work fine.

from url-loader.

littlebee avatar littlebee commented on May 30, 2024

Oh, you are so right! Nevermind. Webpack rules!

from url-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.