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.

random exception code in vue

See original GitHub issue

When I refresh one of my page, the flowing exception is show randomly. When this exception is throw, the view can not be open, if this exception is not show, the page can be opened.

I am sorry I can not provide a reproduce link.

vue version: 2.1.6 dev mode

TypeError: Cannot create property 'function mergeHook(
  parentVal,
  childVal
) {
  return childVal
    ? parentVal
      ? parentVal.concat(childVal)
      : Array.isArray(childVal)
        ? childVal
        : [childVal]
    : parentVal
}' on string 'beforeCreate'
    at mergeField (eval at <anonymous> (app.js:606), <anonymous>:1169:18)
    at mergeOptions (eval at <anonymous> (app.js:606), <anonymous>:1160:5)
    at resolveConstructorOptions (eval at <anonymous> (app.js:606), <anonymous>:3329:32)
    at createComponent (eval at <anonymous> (app.js:606), <anonymous>:2391:3)
    at _createElement (eval at <anonymous> (app.js:606), <anonymous>:2864:15)
    at Proxy.render (eval at <anonymous> (app.js:3090), <anonymous>:91:7)
    at VueComponent.Vue._render (eval at <anonymous> (app.js:606), <anonymous>:2954:22)
    at VueComponent.eval (eval at <anonymous> (app.js:606), <anonymous>:2191:21)
    at Watcher.get (eval at <anonymous> (app.js:606), <anonymous>:1656:27)
    at new Watcher (eval at <anonymous> (app.js:606), <anonymous>:1648:12)

I haven’t used hook beforeCreate in any component.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
renedxcommented, Dec 30, 2016

A FYI; We’re running into this again. This time not store related as in #4556. The main problem with this issue is we can only reproduce this problem on a single (freaking) computer. My computer doesn’t reproduce the exception, nor others. Seems related to simultanously loading components?

It seems we run into this problem when a child component have destroyed, mounted, data, and methods props and the parent component have them too. When we remove the destroyed prop from the lowest-child, it works without problems. But it just seems too sketchy of a fix.

We’re still on this. Just wanted to update so some brains may get triggered on the debug.


We found out that computer doesn’t have the problem on production (npm run build) version of the same code. So we’re currently only experiencing it on npm run dev (webpack bundle, installed using cli)

This kinda simulates the problem we had, but as it is builded version it seems not to run into that problem. So prob something to do with the hot-loading part more.

https://jsfiddle.net/vr0657oL/3/

1reaction
njleonzhangcommented, Jan 28, 2017

Thanks you very much. It works, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Seemingly random lint errors in vue - javascript - Stack Overflow
When I run yarn serve (executes vue-cli-service serve ) it builds without errors, then I edit and save Component.vue I get the following ......
Read more >
Generate random number v-for - Vue Forum
I have a simple v-for loop working fine but I need to generate a random number 1-10 inside each for instance.
Read more >
Uncaught DOMException error with Vue SSR production ...
The "random" was to emphasize the error and make it easier to reproduce, but this can happen with any kind of external data...
Read more >
Chance
Chance is a minimalist generator of random [1] strings, numbers, etc. to help reduce some monotony particularly while writing automated tests or anywhere ......
Read more >
Promise.prototype.finally() - JavaScript - MDN Web Docs
if (Math.random() > 0.5) {. 4. resolve('Mail has arrived');. 5. } else {. 6. reject(new Error('Failed to arrive'));.
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