Prevent IHP RunDevServer from automatically opening a window or tab - ihp

Is there a way to start the server without it automatically opening a tab? Something similar to webpack serve --no-open

You can set the IHP_BROWSER environment variable to echo before running the dev server:
export IHP_BROWSER=echo
./start
This is described in the IHP recipes:
https://ihp.digitallyinduced.com/Guide/recipes.html#dont-autoopen-the-app-in-the-browser

Adding a little more to the accepted answer.
The answer can be found on the Recipes page in the Documentation along with other helpful best-practice solutions. Another solution is to append export IHP_BROWSER=echo to the local .envrc file.
// .envrc
PATH_add /nix/store/...
export IHP_BROWSER=echo

Related

testcafe electron mainWindowUrl | what to do with tmp location

When using testcafe-browser-provider-electron, I get stuck with the mainWindowUrl. I have the original source file in the renderer folder, the version that is in the build folder and apparently a temporary created in some random /tmp/ folder. Testcafe suggests the /tmp/ file.
"Use the mainWindowUrl option to specify one of the following pages as the main window page:
file:///tmp/.mount_PROGRAM-Lbt5yL/resources/app.asar/build/renderer/index.html"
With the 6 chars being random.
How can I instruct testcafe that all files are identical?
I expected no error-message
Error: The main window page at file://....index.html was not loaded.
I reproduced this behavior. Please track the issue in the following thread: https://github.com/DevExpress/testcafe-browser-provider-electron/issues/87. We will research it and update the thread once we have any news.
Found out an alternative path to using the AppImage.
Use electron-builder to build a deb-package. Install that as it will always have the same path /opt/... to the unpacked content. You can then use that path in the specification of the mainWindowUrl.

Creating multi-page application with Vue CLI3.0, how to handle this error?

I am a beginner of Vue and I am trying to build a multi-page web application with Vue for practice. But I am having this problem below:
Failed to compile.
./src/index/views/Home.vue?vue&type=script&lang=js& (./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/index/views/Home.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '#/components/HelloWorld.vue' in '/home/Username/Web/wk_front_end/src/index/views'
Here is the file tree of my project, every file is generated by Vue because I only want to test the multi-page, so I think it wouldn't be a coding problem.
Here is what I did:
I created a folder called the index under the src folder, I then move all the files and folders that originally under src to index because I wish the components and assets are only used in the corresponding page.
My vue.config.js is:
module.exports = {
pages: {
index: {
entry: "src/index/main.js",
template: "src/index/index.html",
filename: "index.html",
title: "Index Page"
},
}
}
When I try to run it, I got the error above on the chrome window. And actually, the error is:
I think it might be caused by missing of configurations, but I really cannot figure out what those other configurations I need.
Does anyone have similar problem before? Does anyone know how to solve it? Or, does anyone have some successful multi-page example that I could take a look?
Really thanks for the help.
I believe # is a shortcut for the src folder. Which would mean your current path resolves to src/components/HelloWorld.vue.
You could try doing #/index/components/HelloWorld.vue, which should be the correct path.
From my sight you may be importing your Vue components incorrectly. If you want to make multi-page-app why don't you try vue-router ? Maybe it's not the direct solution for your problem but it will help you to better manage your pages (routes) in the future.

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!

Phinx path with subfolders

i want to have a better overview on the phinx migration files. i want something like this
/db/migration/1.8.5/ID-2065/my_file_name_1234567890
So i can use
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations/'. $_ENV['APP_VERSION'],
In the docs only is something like this
migrations: %%PHINX_CONFIG_DIR%%/module/*/{data,scripts}/migrations
But how can i use there maybe a param from the command line.
See you
If your using the default YAML based configuration you can try using Phinx ENV vars (PHINX_ prefix) and then use a %%PHINX_VARNAME%% replacement. Note: I haven't actually tried this before. Read more about them here: http://docs.phinx.org/en/latest/configuration.html#external-variables
Otherwise if your using a PHP-based configuration file you can definitely access the $_ENV superglobal as you have described. Just be sure to call your bootstrap/init scripts so your application version is injected.
Rob

I am getting a "Bad response from Chimp Server" in my console when trying to run a meteor app with velocity/cucumber testing on it

The error is not in my regular console, it's in my tail -f console. It won't run the tests at all. In my localhost:3000 velocity sidebar it also says chimp server error. I am not sure how to fix this, I am very new to velocity and cucumber so it could be a stupid mistake, but I couldn't find any information on this error anywhere.
could you provide us with the whole meteor log and also cucumber log? If possible - please do meteor reset first (be aware though that this will clean up your local mongodb, if you want to avoid that, at least clean the cucumber log - echo '' > filePath will work )
I ran into the same problem yesterday while trying to follow Josh Owen's now outdated cucumber tutorial. The error was coming from with the step definition file while not wrapping module.exports in a function like this:
(function() {
module.exports = function() {
// ...
}
});
It could also be that your test directory and files aren't structured correctly in your app.
It should look like this:
app/
tests/
cucumber/
features/
step_definitions/
my_steps.js
my_feature.feature
fixtures/
my_fixture.js
Let me know if that makes a difference. Also, this is a good place to start with velocity/cucumber: http://www.mhurwi.com/a-basic-cucumber-meteor-tutorial/
It's very basic but there isn't much out there for learning testing with Meteor.