VueJS Watcher not initializing correctly on Safari 12+ - vue.js

I run into a Problem with vueJS at version 2.6.11 and Safari version 12 and 13.
On some pages of the webapp the vue watchers are not initalizing correctly, appearently because of a race-condition inside the vue initalization.
The error results in, that on some pages of the Webapp, none of the v-if bindings and stuff like this works anymore.
Currently on version 2.6.11 i even do not get an error. Luckily on an older version (don't remember exactly which one it was), i got an console error which leaded me to:
this.getter.call(vm, vm);
in vue/src/core/observer/watcher.js:106
with the error string does not match the expected pattern
setting breakpoints to this part of the code, when the exception appeared, and running this.getter.call(vm, vm); again using the browser console, results in a working page after the rendering is finished. So it seems to be because of a race-condition i guess ?
This part of the code is called multiple times during the app initalization.
this.getter is using the function function (){e._update(e._render(),n)} (minified), when the error appears.
Anyone encountered the same issue, and/or knows a fix for this problem ?

Related

Nestjs start fails silently in module initialization

Running nest start
The module initialization fails silently without error at const app = await NestFactory.create<NestExpressApplication>(AppModule);
This seems to fail after the CqrsModule dependency is initialized. I dont see anything in the logger I have setup, would this be reported anywhere else?
It quits directly after the last line above.
The problem for me was using a newer version of node. Once I switched to the original node version in my project, I started getting errors.
I had the same issue and solved it after realising that I had a service that was calling itself in its constructor.
Once removed, everything started working back as usual.

Vue Cli remote preset crashes on Invoking Generators

i'm trying to create a remote vue cli preset on github, but for some reason i keep getting a syntax error.
My preset repo: https://github.com/christoph-schaeffer/vue-preset
The command i have entered: vue create --preset christoph-schaeffer/vue-preset testProject
The Error i get:
🚀 Invoking generators...
ERROR SyntaxError: Identifier 'router' has already been declared (15:7)
SyntaxError: Identifier 'router' has already been declared (15:7)
at Object._raise (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:762:17)
at Object.raiseWithData (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:755:17)
at Object.raise (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:749:17)
at ScopeHandler.checkRedeclarationInScope (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:4826:12)
at ScopeHandler.declareName (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:4792:12)
at Object.checkLVal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:9367:22)
at Object.checkLVal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:865:15)
at Object.parseImportSpecifierLocal (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12706:10)
at Object.maybeParseDefaultImportSpecifier (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12751:12)
at Object.parseImport (/usr/local/lib/node_modules/#vue/cli/node_modules/#babel/parser/lib/index.js:12677:31)
At first it worked fine, then i've added several things in the preset.json along with a generator template.
After getting the error i've tried reverting the whole repo to the state it had when it was still working. However i still get that error...
I guess it's not really about the preset but instead an issue with my global babel package or something?
I'm using vue-cli version 4 and im working on a mac
Any directions on how i could get this running would be highly appreciated
I've found the issue.
First: the vue cli somehow seems to cache remote presets. That's the reason why it didn't work even after reverting changes.
The actual issue was, that the main.js shouldn't be changed like the other template files and needs special attention. For some weird reason it gives those random errors as soon as you have a main.js in your template.
If anyone is curious on how to modify your main.js in a preset check out :
https://cli.vuejs.org/dev-guide/plugin-dev.html#changing-main-file

String functions not working in electron app

I have a .js file inside an electron app that uses the quasar framework.
inside this file i have axios to make requests to my api to pull data
once i get the response i use the data for further processing. However i need some string functions to escape some strings and when i try .replace it just fails.
var t = JSON.parse(JSON.stringify(someObj))
console.log(t.message.replace(/"/g, '\\"');)
the app just fails to build and tells me there is some error in x line. if i use console.log(t.message) i see that it print the text in the terminal console, so i know the value is not null.
Also when i hover my mouse over the variable it tells me (any) not sure what this means.
image:
P.S: this is my first time working this tech stack.
turned out there was a configuration issue with babel inside electron that was using quasar framework, it didn't not accept commonjs as module and hence no vanilla javascript would work.
Just had this issue myself, I know you've answered your own question but if you can use nodejs you can install replace-string from npm and use it
command: npm install replace-string
link:
https://www.npmjs.com/package/replace-string
This issue has literally caused me a morning of work - but hope someone finds this post and fixes this issue quicker!

How to fix unknown elements of vue-router (e.g. router-view, router-link)?

I set up a new vue-project that was created using vue ui and manually selecting the features.
The features are the following:
Babel
Router
Vuex
Use config files
and only that, and run the project using the development mode; however, an error occur in the console (Dev tools) showing an unknown elements for router-link and router-view.
https://github.com/JeromeDeLeon/vue-router-bug
That is the repo (a newly created one like hello world program). I already posted an issue on vue-router github page but eventually got closed because they said that everything was working properly, but it is not working for me.
I tried changing the Router to VueRouter on router.js, but the result is still the same.
I tried transferring the code of router.js to main.js, but still not working.
The expected result is to show the content of Home.vue in order to check if router is working.
The actual result shows the "Home | About" only in the top-middle of the browser and nothing else.

Polymer 2 site cant find resources in Safari

I built this site http://danielleandsteven.wedding/ and it loads fine in most browsers. In Safari, I get a lot of errors that it cant load resources and the my-app elem is empty.
A quick glance of the list of 404 resources- it looks like some of them are for nonexistent components and others are in /bower_components/ but its looking for them in the base directory.
I tried it on Edge 15 and I got
Object doesn't support property or method 'call'.
You could add the Babel Polyfills?
https://babeljs.io/docs/usage/polyfill/
it adds some basic function that babel code may depend on - and as you probably served transpiled ES5 code (with babel) to those browsers it might be your problem.