Uncaught TypeError: ResizeObserver is not a constructor
See original GitHub issueI am getting the error Uncaught TypeError: ResizeObserver is not a constructor when trying to use Uppy in my app. I am using it in a VueJS app that I am working on. Below is a sample of the code that I am currently working on.
` const Uppy = require(‘@uppy/core’); const Dashboard = require(‘@uppy/dashboard’); const XHRUpload = require(‘@uppy/xhr-upload’); const Form = require(‘@uppy/form’);
initiateUppy() {
let self = this;
self.uppyData = Uppy({
id: 'blog-featured-image',
debug: true,
autoProceed: false,
restrictions: {
maxFileSize: 4096000,
maxNumberOfFiles: 1,
minNumberOfFiles: 1,
allowedFileTypes: ['image/*']
}
})
.use(Dashboard, {
trigger: '.attach-message-image',
inline: true,
target: '.DashboardContainer',
hideUploadButton: true,
replaceTargetContent: true,
note: 'Images only, 1 file, up to 4 MB',
height: 300
})
.use(Form, {
target: '#blog-form'
})
.use(XHRUpload, {
endpoint: self.uploadUrl,
fieldName: 'files[]',
bundle: false,
formData: true,
headers: {
'X-CSRF-TOKEN': window.CoronaCms.csrfToken,
'section': 'blog-feature-image'
},
getResponseError(content, xhr) {
console.log(content);
console.log(xhr);
return JSON.parse(content);
}
});
self.uppyData.on('file-added', (file, data) => {
self.filesUploaded++;
});
self.uppyData.on('file-removed', (file, data) => {
self.filesAttached--;
});
self.uppyData.on('complete', (result, xhr) => {
displaySuccessMessage(`<strong>${self.article.title}</strong> has been updated successfully`);
self.$appBusEvent.$emit('hide-action-loader');
self.$router.push({name: 'blog.articles'});
self.$appBusEvent.$emit('refresh-data-table');
// self.reset();
})
}
`
I have attached a screenshot of the error I am getting.
Does anyone have an idea on how to resolve this issue?
Thanks
Manny
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
TypeError: window.ResizeObserver is not a constructor #217
I am getting this error on roughly 35% of my tests -- just as was described in issue #145 package.json { "name": "winter-web-app", ......
Read more >ChartJs 3.x: ResizeObserver is not a constructor
I get the error "TypeError: ResizeObserver is not a constructor". I tried to replace the ChartJs resource with older versions, and I found...
Read more >[ResizeObserver is not a constructor] - Salesforce Stack ...
I am using Pixi.Js and graphology using static resource in lightning aura component. While generation of graph using these libraries I am facing ......
Read more >ResizeObserver() - Web APIs | MDN
The ResizeObserver constructor creates a new ResizeObserver object, which can be used to report changes to the content or border box of an ......
Read more >ChartJs 3.x: ResizeObserver is not a constructor-Chart.js
[Solved]-ChartJs 3. x: ResizeObserver is not a constructor-Chart. js. It could be you are attempting to run it in a browser/version combination which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fix released in latest
0.27.5
: https://npmjs.com/package/@uppy/dashboard. Please update and let me know if it works for you!I think this might be a similar issue as we had in the past with get-form-data, where some tools use the CommonJS build and some use the ES modules build, and the exports don’t match. According to #1073, it works with
.default
(assuming an ES modules build is used), but in browserify and other CommonJS based tools it only works without.default
.