I don't know why Vue acts differently with Laravel than standalone Vue app. Maybe I can't understand the environment it needs to work correctly. Here is what's happening which made me post this question.
When I install standalone Vue app, Let's say, when I install it in a completely different directory using vue init webpack vueapp, It works as it should. When I update anything in .vue file, It gets updated in the browser too which is expected behaviour in my mind or maybe it's because I am executing it in a development environment using npm run dev.
But when I use vue with laravel, I can load the modules and I can see loaded modules in the browser, but when I update something a component, It won't update in the browser! It just does not. I have to reload a page every time I update markup in the component file.
Also, when I execute npm run dev in the vue app with Laravel, It does not take over the terminal as it does in the standalone vue app. It is obvious as we can't execute vue as well as laravel in the same development environment as vue uses nodejs which uses the port 8080 and apache uses the port 80.
I don't know what I am missing but it's eating my head since last few days. I surfed almost all the tutorials available on the internet and all the available StackOverflow questions but still, I can't get it! I think it's the normal behaviour but I have less experience with vue.js as I am a newbie in vue.js.
Any help would be appreciated!
What you are saying is true and it was meant to be that way.
But you can use a library that comes withlaravel to accomplish that. first.
add .browserSync(); to your webpack.mix.js
instead of npm run dev use npm run watch. This will help you not to refresh.
and that is how you have the same effect. Hope its not much.
Related
so I am making an application that requires a backend API, and it uses certain node_modules which don't work when compiling with Electron. To fix this, I put the API code into a separate JavaScript file, which I am attempting to fork using child_process.
I have gotten this to work when compiling, but it immediately stops working after I move the "win-unpacked" folder or try to install the app using the compiled installer.
I have checked, and it is not the path that is wrong, it is correctly pointing to the file. From testing, it appears that the file actually does get forked, but immediately exits with the status code 1.
I can't use require(./filepath.js) because that will just include the code in the compiler, which doesn't work with the modules I am using.
I am hoping someone knows what is wrong and what I should do to fix it, or have any ideas for other ways to run the server code without including it in the compiler.
I am using Vue.js 3 and vue-cli-electron-builder version 2.1.1
The server I am attempting to run is a express server.
I'm having a problem with deploying my project.
It's VueJs project, a web app, build on Metronic template with Vuetify components.
When I publish, I use visual studio code with npm run build and upload the dist folder to my server.
I have a version-check problem.
Some of my clients cannot get the latest version, without hard reloading. ctrl-shift-r they are using chrome and when incognito mode is on everything is perfect. But normal mode brings a very old version of the app.
I need a solution on the code or server-side, thank you for your help
I solved my problem and I forgot to post my answer. My problem was because of the PWA package I installed and implemented in the beginning of the project.
When I try to remove PWA from my project, what I did was commenting the code blocks but not removing dependency from my packacge.json.(mistake) So, I was thinkin, *"Since I'm not calling any of the PWA functions or initialize it, it should've been removed."
yeah, not.
It was still there, caching stuff.
So I removed (uninstalled) the dependency from my packacge.json, and even after that, people who did installed PWA before and "not uninstalled properly" was still using cache! (yeah, you have to click uninstall and also check remove files option)
so I had to, manually uninstalled my PWA app from their chrome (thankfully it was only few) and problem solved.
I am using nuxt.js for my frontend app. I currently have a problem with asyncData especially the first time it is run (which is on the server).
When building my app ($ nuxt build and serving it via $ serve), I currently have no real possibility to console.log some information out from the code that is run on the server. How can I debug that part, before code is run on my client?
Would this be a way:
https://codeburst.io/debugging-nuxt-js-with-visual-studio-code-724920140b8f
So I would launch nuxt manually with node.js and try to inspect something there?
Or is there a better way?
The nuxt build properties (https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) are just for analyzing the build right? Like package sizes etc, and not for actual code that is run on the server?
I hope I could make clear what I am looking for, if not I am happy to answer further questions.
Any hints are very welcome. Thank you in advance.
cheers
I'd like to get in my RN app a variable from the environment somehow.
I've tried few things like: MY_VAR=foo node... this doesn't pass my JS file
I've tried using the --root option in RN CLI but this doesn't give me a complete solution as when using xcode to actually run the code with the bundler, they run, hard-coded index.js
What are my options?
I need to know somehow - where this code runs - which for it, to my understanding i need to pass some environment variable somehoe
It depends on the method you create your RN app, but here are the options for both:
if using react-native init:
react-native-config, it's an easier set up than so far what i read.
-setup .env.dev and a few others you want. yarn add react-native config, set up using gradle, IOS has another method so read through the documents. then run ENVFILE=.env.dev react-native run-ios
create-react-native-app:
You may have the webpack, which means it would help you.
If you decided to eject your app from create-react-native-app, please go with react-native-config.
https://webpack.js.org/plugins/environment-plugin/
Good luck!
I've googled around for an answer but have yet to turn up anything of use. Does anyone know why attempts to run ember test at best result in a message that reads:
Built project successfully. Stored in "/Users/.../tmp/class-tests_dist-H42JePnK.tmp".
If your tests won't run at all, here are a few things to look for:
Check for a testem.js file. It is essential and contains the instructions and configurations that the Ember CLI needs. Deleting it will cause your app to build and 0 tests to run.
Check to make sure your testem.js file is valid/complete. You can test this by doing ember init and then choosing option d (diff) to see what is different between your app and a brand new app.
Your tests are also available in the normal browser. Go to http://localhost:4200/tests and see what happens there. Perhaps it will give some clues.
Similar to above, try ember test --server and see if you get different results.
Create a fresh app with ember new and try doing ember test. It can sometimes be easier to compare a fresh app instead of doing the ember init diffing.
Try switching the browser you are using for testing (unlikely to be the problem in this case, but sometimes works). For example, run the tests with headless Chrome instead of PhantomJS. The most recent release of the Ember ClI has the testem configuration that you need to try headless Chrome.