autoNumeric / autoNumeric

AutoNumeric is a standalone library that provides live as-you-type formatting for international numbers and currencies.

Home Page:https://autonumeric.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source has vanished from CDN server, just so you know

applemad opened this issue · comments

I have been using your brilliant script for a while now, all of a sudden our page is breaking and the console error is as follows, just thought you should know.

[Error] Failed to load resource: the server responded with a status of 404 () (autoNumeric.min.js.map, line 0)

https://cdn.jsdelivr.net/npm/autoNumeric.min.js.map

This was the code I had in my page

<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.1.0"></script>

I have also tried changing it to the latest version:

<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>

and even tried hosting it locally and it still fails, really strange ..

Ok weirdly if you use this instead doesn't error, so I'm assuming differences of some kind in either the way its served or in the source on the server itself, as this version looks like an even later version, 4.6.0 on this CDN

<script src="https://unpkg.com/autonumeric"></script>

I did try saving this source on my local server but when I try to load it from my own server it throws the error again, so no idea whats happening there lol

@applemad The reason you are getting the above error (actually everyone will get this error!) is because the autoNumeric.min.js file has a reference to the autoNumeric.min.js.map (source map) file on its very last line.

//# sourceMappingURL=autoNumeric.min.js.map

The browser will try to load the source map file but since it can't find it, you will get the 404 error. The source map is only useful if you are debugging the autoNumeric code. So you can safely ignore the 404 error.

If it bothers you, you can host the autoNumeric.min.js on your local server and remove the last line. Removing the sourceMappingURL reference will fix your problem.

@applemad can you please mark this issue as solved? :)