-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Initial checklist
- I understand this is a bug report and questions should be posted in the Community Forum
- I searched issues and couldn’t find anything (or linked relevant results below)
Link to runnable example
No response
Steps to reproduce
- Start nginx reverse proxy with a basic html call like
try_files $uri $uri/ /index.html; - Wind up a basic uppy setup with this content:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Upload - Uppy</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://releases.transloadit.com" />
<link
href="https://releases.transloadit.com/uppy/v5.1.2/uppy.min.css"
rel="stylesheet"
/>
<style>
#files-drag-drop .uppy-Root .uppy-Dashboard {
display: unset;
}
</style>
</head>
<body>
<div id="files-drag-drop"></div>
<script src="https://releases.transloadit.com/uppy/locales/v5.0.0/de_DE.min.js"></script>
<script type="module">
import {
Uppy,
Dashboard,
Tus,
} from 'https://releases.transloadit.com/uppy/v5.1.2/uppy.min.mjs';
console.log(Uppy.locales);
const uppy = new Uppy({
locale: Uppy.locales.de_DE,
});
uppy.use(Dashboard, {
target: '#files-drag-drop',
proudlyDisplayPoweredByUppy: false,
});
uppy.on('complete', (result) => {
if (result.failed.length === 0) {
window.location.assign('/upload/danke')
} else {
console.error('Upload errors:', result.failed)
}
})
</script>
</body>
</html>
- Visit your domain
Expected behavior
The Uppy Upload Form should be showing and the text should be in german
Actual behavior
The Uppy form is not loading because of an exception while initializing Uppy.
Errormessage:
Uncaught TypeError: Cannot read properties of undefined (reading 'de_DE')
at danke:36:24
so basically in the line:
const uppy = new Uppy({ locale: Uppy.locales.de_DE });
And Uppy.locales is returning undefined.
So it seems there is a problem initializing the locales attribute.
See:
Also sidenote:
The Docs on https://uppy.io/docs/locales/ are very outdated and are still recommending very old versions of uppy and the locales script
Thanks in regard for your help;)