Giter Site home page Giter Site logo

Comments (7)

ryanpitts avatar ryanpitts commented on May 24, 2024

FWIW, specifically adding the .map file to the request:

[email protected](underscore-min.js+underscore-min.map)

Does not help, because dev tools still makes the automatic request to the /g/ directory.

from api.

jimaek avatar jimaek commented on May 24, 2024

Not sure how to fix this. I can detect when /g/ gets requested a map file but not I don't know how to figure out what project contains the map file. Not even speaking of the version of the project.

Would it work if I simply responded with an empty 200 reply?

from api.

ryanpitts avatar ryanpitts commented on May 24, 2024

An empty 200 would end up breaking the .map functionality in dev tools too, so that wouldn't be any better than the 404.

The only way I can think to determine which project+version will need the .map file is when you're compiling the minned javascript in the first place. In order to support .map, I believe a js file is supposed to have a line like //# sourceMappingURL=underscore-min.map, so it might be possible to detect that, and as you are minning the file, rewrite the = location to the proper place (which would be whichever directory you're retrieving the actual .min js from).

from api.

jimaek avatar jimaek commented on May 24, 2024

The browser makes a separate HTTP request for the map file. So I don't know what URL originally generated the .map request. And I don't want to modify the files in any way. Users should know what they are getting before hand. No on-the-fly rewrites.

I say empty 200 because at least this way there are no warnings/errors. And there is absolutely no reason to use map files in a grouped URL, they are meant for debugging. If you want to debug a library you should do it at least by loading the normal file or even better the unminified one :)

What do you think?

from api.

jimaek avatar jimaek commented on May 24, 2024

I deployed the fix. In any case its better to get rid off 404 errors.
Let me know what you think on this topic.

P.S. This is the API repo, you should use jsdelivr/jsdelivr next time for this kind of issues :)

from api.

ryanpitts avatar ryanpitts commented on May 24, 2024

Oh wow, I didn't realize I was leaving issues in the API repo!

You're right, if someone wants to debug a library, they ought to be loading the file independently. Makes sense to me. I wasn't needing to debug, we just noticed the 404.

from api.

brgrz avatar brgrz commented on May 24, 2024

Still an issue with this
jsdelivr/jsdelivr#3814

from api.

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.