Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jio-locale attempts to load from the wrong location #64

Open
NotMyFault opened this issue Feb 21, 2023 · 4 comments
Open

jio-locale attempts to load from the wrong location #64

NotMyFault opened this issue Feb 21, 2023 · 4 comments

Comments

@NotMyFault
Copy link
Member

On plugins.jenkins.io I noticed that jio components complain about the wrong locale code:
Screenshot 2023-02-22 at 00 53 21
The script points to https://cdn.jsdelivr.net/npm/@jenkinsci/jenkins-io-components@1.17.1/src/jio-locale.ts, however, should point to the declaration file located at https://cdn.jsdelivr.net/npm/@jenkinsci/jenkins-io-components@1.17.1/build/jio-locale.d.ts

@halkeye
Copy link
Member

halkeye commented Feb 22, 2023

i don't think it does either of those things, I think that's just the source map saying where the initial location was.

https://github.com/jenkins-infra/jenkins-io-components/blob/main/src/jio-locale.ts#L19

The error message is just saying your browser doesn't match a locale we have translations for, so goes back to default

@NotMyFault
Copy link
Member Author

Browser tools complain about:
Could not load content for https://cdn.jsdelivr.net/npm/@jenkinsci/jenkins-io-components@1.17.1/src/jio-locale.ts (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)

@halkeye
Copy link
Member

halkeye commented Feb 22, 2023

huh weird, looks like its something todo with source maps. Maybe i need to include src in the packagefile or something for it to expand properly. I originally tried to strip out anything that wasn't needed to reduce file size, but the cdn doesn't download the entire package, just files it needs.

Its just a warning doesn't really break anything, but good to fix.

@halkeye
Copy link
Member

halkeye commented Feb 22, 2023

 ag jio-locale.ts
custom-elements.json
790: "path": "src/jio-locale.ts",
807: "module": "src/jio-locale.ts"
815: "module": "src/jio-locale.ts"

build/jio-locale.cjs.js.map
1:{"version":3,"file":"jio-locale.cjs.js","sources":["../src/generated/locale-codes.ts","../src/jio-locale.ts"],"sourcesContent":[null,null],"names":["execute","configureLocalization","targetLocales","loadLocale","locale","_configureLocalizatio","getLocale","setLocale"],"mappings":"mzNAGA,GAAAA,QAAA,gBCAkCC,EAAAA,EAAA,mBAa/BC,qCAEIC,WAAA,SAAAC,2NAf2BC,EAAAC,UAAAC,IAAAA"}

build/jio-locale.esm.js.map
1:{"version":3,"file":"jio-locale.esm.js","sources":["../src/generated/locale-codes.ts","../src/jio-locale.ts"],"sourcesContent":[null,null],"names":["getLocale","setLocale","configureLocalization","targetLocales","loadLocale","locale"],"mappings":"4DAoBG,KACI,kBClB2BA,UAAAA,EAAAC,UAAAA,GAAAC,EAAA,mBAa/BC,gBAEIC,WAAAC"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants