Skypack CDN failing to return Stimulus packages
I'm currently getting a 404 when madmin attempts to import Stimulus from the Skypack CDN.
The import URL madmin uses is: https://cdn.skypack.dev/stimulus
When I access that in the browser, I see
/*
* Skypack CDN - [email protected]
*
* Learn more:
* 📙 Package Documentation: https://www.skypack.dev/view/stimulus
* 📘 Skypack Documentation: https://www.skypack.dev/docs
*
* Pinned URL: (Optimized for Production)
* ▶️ Normal: https://cdn.skypack.dev/pin/[email protected]/mode=raw/stimulus
* ⏩ Minified: https://cdn.skypack.dev/pin/[email protected]/mode=raw,min/stimulus
*
*/
// Browser-Optimized Imports (Don't directly import the URLs below in your application!)
export * from '/-/[email protected]/dist=es2019,mode=raw/stimulus';
export {default} from '/-/[email protected]/dist=es2019,mode=raw/stimulus';
When I check the export urls (https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=raw/stimulus), I get an error:
Not found: stimulus/3.1.0/3/stimulus
Did the recent release of Stimulus 3.1.0 break these imports? See https://github.com/hotwired/stimulus/releases/tag/v3.1.0
We fixed this in our project by overriding this template: https://github.com/excid3/madmin/blob/8f29bfd1e3d7dc1149c86c86e18dd6e8e684a87f/app/views/madmin/application/_javascript.html.erb#L6 and pinning Stimulus to v3.0.1:
import { Application, Controller } from 'https://cdn.skypack.dev/[email protected]'
Looks like this is happening again, this time with Turbo. Fixed by pinning to 7.1.0:
import * as Turbo from "https://cdn.skypack.dev/@hotwired/[email protected]"
This has been fixed. 👍