ionic 4 sub paths not loading when running ionic serve - ionic-framework

I had an ionic 4 beta project of --type=angular that was loading at any path without issue.
Periodically, i have been updating my packages by running an npm update and am currently at:
"#ionic/angular": "^4.0.2"
as well as updated installs for the ionic cli, and am currently at:
CLI 4.10.3
I am not sure when this app loading issue started, but i suspect it was after running the last npm update or update install of the cli.
When running ionic serve my application loads correctly, and i am able to navigate to all sub paths without any issues.
However, when:
• refreshing the browser while viewing a sub path
• attempting to enter a url with a sub path
• live reloading while viewing a sub path
the app attempts to load all js files relative to the sub path and fails to run like so:
http://localhost:8100/page/sub/path
fails to load because the app attempts to load runtime.js here:
http://localhost:8100/page/sub/path/runtime.js
my base href is currently set to ./
When i inspect the html source, the script tags are formatted as follows:
<script type="text/javascript" src="runtime.js"></script>
If i attempt to load a page directly at the root, the application loads ok without issue like so:
http://localhost:8100 loads OK
http://localhost:8100/page loads OK
So again to recap, the app only fails to load the js assets at a sub path.
Any idea where to begin troubleshooting?

For anyone running into this same problem, i have the answer.
I am not sure when or why, but my base href was set incorrectly and this was the problem.
I changed my base href from ./ to / and this solved my problem.

Related

Disable .vscode-server/data/user/history caching

i use nextjs in vscode and every time i build my app with
npm run build
the buildId and old build path are saved in .vscode-server/data/user/history I want to disable this because for some reason my nextjs app uses that old info sometimes and changes my new build on itself what results in a 404 error for the buildManifest.js file. This is because it uses the old folder name but the folder has a different name (generated with npm run build). I do this with SSH to my raspberry pi. Let me know! Thanks.

Angular module federation: Webcomponents and assets static file sharing between MFE and Shell application in polyrepo scenario

Currently i am facing two problems:
I have two repos one for shell and another for MFE application
Here is the version o module federation
#angular-architects/module-federation": "^14.3.12
First Problem:
I have webcomponent created which is custom grid and it created separately in different repo. And this components is install via npm (added in package.json file) in MFE application project. And add the necessary files in script section of angular.json file. MFE application run properly when standalone. But when we use the MFE in shell application the shell application doesn't show the custom webcomponent. Only way to work is to install the same webcomponent in shell as well to work.
So anybody any idea how can share the webcomponents which used by MFE in shell application instead of installing in shell application project?
Second Problem:
Another problem I currently facing is sharing static files between MFE application and shell.
I have env.js file which has api call urls which is used by MFE application.With MFE application its works correctly.
But when I load the MFE application in shell application it doesn't recognizes the API url call because it tries to search in its asset folder instead of assets folder of MFE application?
Please let me know what i am missing here?
I tried with webconfig.js files in MFE application which angular module federation has created but didn't got any break through to these problems

Flutter web located in a server folder

I have recently upload a flutter website inside of a folder in my server.
But it's not working well. I have notice that main.dart.js needs to have the folder name in the url. But It is not working well... What more things I have to change for running the website without more problems?
Try adding the base path to you're index.html.
Example:
<base href="/FolderName/">

Ionic 2 www empty folder

I am trying to test a sample Ionic2 app. I have started using ionic start AppName --v2.
Got the code in local with src folder. But the www folder is empty. When I do ionic serve, its opening the app in browser and throws the below error.
Error: ENOENT: no such file or directory, open 'path\to\folder\www\index.html'.
www folder is not getting updated with the compiled code. Nor build folder is getting generated inside the src folder. I have typescript and other compilers installed as well.
Try re-installing ionic framework, and making sure your CI is updated.
It could also be a permission issue, have you tried using sudo ?
sudo ionic start AppName tabs --v2 --ts
also make sure you are at the root of your application when running
ionic server

cordova 1.7.0 set info error

I am using cordova 1.7.0. My app is running fine in simulator but a message comes like
Error: executing module function 'setInfo' in module 'cordova/plugin/ios/device'. Have you included the iOS version of the cordova-1.7.0.js file?
I have included
<script type="text/javascript" charset="utf8" src="[location of cordova.ios(for ios)]"></script>
in index.html but did not work.Plz help.
there must be something wrong with the path to the js.
The index.html file is read?
Is your www folder maybe a group instead of a reference folder?
Go step by step
This generally happens when the cordova file is not properly available when the page is loaded. You can check that it is referencing properly by opening the index.html (or your start page) in the Chrome and check in Inspect Element that all the resources are loaded and there are no errors.
to solve this problem, just follow steps in picture