question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: ResizeObserver is not a constructor

See original GitHub issue

I 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.

screenshot_30

Does anyone have an idea on how to resolve this issue?

Thanks

Manny

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
arturicommented, Sep 27, 2018

Fix released in latest 0.27.5: https://npmjs.com/package/@uppy/dashboard. Please update and let me know if it works for you!

1reaction
goto-bus-stopcommented, Sep 25, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found