Nuxt.js: [nuxt] Error while mounting app: HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.

Created on 26 Apr 2019  Â·  8Comments  Â·  Source: nuxt/nuxt.js

Hi,

I have uploaded my nuxt app to a plesk server.

I ran build --scripts-prepend-node-path to create .nuxt folder. i then ran start --scripts-prepend-node-path

The site "works" but not all the features/events work.

When i open the console. i get the following errors

  TypeError: Cannot read property '$scopedSlots' of undefined @ _nuxt/259a4998f26830aa9f74.js:2

this error correlates to the following function

   function te(t, e, n) {
        if (!tt && !et || "undefined" == typeof console)
            throw t;
        console.error(t) //<-- this is the error
    }

Additionally, the following error is included

 Error: [nuxt] Error while mounting app: HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method. @ _nuxt/989b40654fd3805a3347.js:3460

this error correlates to this piece of code (which is part of a larger snippet)

 function L() {
        return (L = Object(n.a)(regeneratorRuntime.mark(function e(o) {
            var t, n, l, d, h;
            return regeneratorRuntime.wrap(function(e) {
                for (; ; )
                    switch (e.prev = e.next) {
                    case 0:
                        return v = o.app,
                        m = o.router,
                        o.store,
                        e.next = 5,
                        Promise.all(C(m));
                    case 5:
                        return t = e.sent,
                        n = new r.default(v),
                        l = w.layout || "default",
                        e.next = 10,
                        n.loadLayout(l);
                    case 10:
                        if (n.setLayout(l),
                        d = function() {
                            n.$mount("#__nuxt"),
                            m.afterEach(E),
                            m.afterEach(R.bind(n)),
                            r.default.nextTick(function() {
                                A(n)
                            })
                        }
                        ,
                        n.setTransitions = n.$options.nuxt.setTransitions.bind(n),
                        t.length && (n.setTransitions(k(t, m.currentRoute)),
                        y = m.currentRoute.matched.map(function(e) {
                            return Object(c.b)(e.path)(m.currentRoute.params)
                        })),
                        n.$loading = {},
                        w.error && n.error(w.error),
                        m.beforeEach(_.bind(n)),
                        m.beforeEach(O.bind(n)),
                        !w.serverRendered) {
                            e.next = 21;
                            break
                        }
                        return d(),
                        e.abrupt("return");
                    case 21:
                        h = function() {
                            E(m.currentRoute, m.currentRoute),
                            S.call(n, m.currentRoute),
                            d()
                        }
                        ,
                        O.call(n, m.currentRoute, m.currentRoute, function(path) {
                            if (path) {
                                var e = m.afterEach(function(o, t) {
                                    e(),
                                    h()
                                });
                                m.push(path, void 0, function(e) {
                                    e && x(e)
                                })
                            } else
                                h()
                        });
                    case 23:
                    case "end":
                        return e.stop()
                    }
            }, e)
        }))).apply(this, arguments)
    }
    Object(h.b)().then(function(e) {
        return L.apply(this, arguments)
    }).catch(function(e) {
        var o = new Error(e);
        o.message = "[nuxt] Error while mounting app: " + o.message,
        x(o) // <-- ERROR
    })

Any help is greatly appreciated

This question is available on Nuxt community (#c9121)

Most helpful comment

Hi,
I have the same problem after deploying to production.

All 8 comments

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c9121.

Hi, do you fix it?
I have the same problem

Hi,

I cannot honestly remember what i did.... I know for certain that i was running into problems when i created a directory with the admin user/root user and then uploaded/modified the app root folder structures using a different user i would run into problems. If you like me uploaded the contents of the app using ftp make sure you are using the same user as the owner of the directory

i also updated and then reinstalled all my packages

Hi,
I have the same problem after deploying to production.

Check this thread for solution: https://github.com/nuxt/nuxt.js/issues/5800

I'm not sure that my case is very frequent but maybe this info will be useful for somebody - I've lost 3 days of debug on production instance and exactly in Facebook browser. I user this service for remote debug of js console - remotejs.com/ (it's not adv, just other tools don't work).
So I had next error:

Error: [nuxt] Error while mounting app: HierarchyRequestError: Failed to execute ‘appendChild’ on ‘Node’: This node type does not support this method.

It happened not on every page load, ~ 7 times from 10 and only in one page - single article page (it's news blog).
And I've found a reason - it was Google Auto Ads. Auto Ads tries to insert html to the DOM but not at correct time point. So I've switched off Auto Ads feature in Google Ads console and it helped.

i recently had this issue, and i was running in SSR, worked fine on local but not in heroku. The issue was i was displaying an iframe but i needed to wrap the iframe with tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

surmon-china picture surmon-china  Â·  3Comments

maicong picture maicong  Â·  3Comments

vadimsg picture vadimsg  Â·  3Comments

bimohxh picture bimohxh  Â·  3Comments

shyamchandranmec picture shyamchandranmec  Â·  3Comments