Chrome gives a 401 error for manifest.json - flutter

I have a Flutter UI (Web channel) app that is deployed as a bundled Spring-boot app ( build files dropped into the main/resources folder in the Spring-boot project). The issue I'm facing is that every time I load the app in Chrome and login I see a 401 error pointing to the manifest.json.
I don't face the same issue when I test my UI locally using Android Studio. This setup uses a modified version of the spring-boot app that is running in Docker.
My manifest.json file is :
{
"name": "ccccc",
"short_name": "ccccc",
"start_url": "/#/",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "basicapp",
"orientation": "landscape-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/cd-16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "icons/cd-32png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "icons/cd-64.png",
"sizes": "64x64",
"type": "image/png"
},
{
"src": "icons/cd-256.png",
"sizes": "256x256",
"type": "image/png"
}
]
}
And the error that I see is :
{"timestamp":"2021-09-30T18:34:24.329+00:00","status":401,"error":"Unauthorized","message":"","path":"/manifest.json"}
I thought this problem was similar to this but that fix did not work.
I then removed the reference to manifest.json from my index.html
i e. <link rel="manifest" href="manifest.json"> and that got rid of the error but not sure if that is the right thing to do.
Not sure what the issue is here, it does not stop me from logging into the app but it's just an annoyance to see that as the first thing in the console log.
Any help/assistance to fix this is greatly appreciated.

You should try this solution where <link> must use crossorigin="use-credentials" tag. I was having the same problem that you and this solved it. Hope you too!

Related

VS Code debugging : breakpoint is not hitting

I have a sailsjs app in docker container and would like to debug through vs code.
I currently have nodemon working and debugger listening at a port.
Strangely my vs code is not hitting breakpoint.I tried below launch config.
"configurations": [
{
"name": "Docker: Attach To Node",
"type": "node",
"request": "attach",
"address": "localhost",
"restart": true,
"port": 9229,
"localRoot": "${workspaceFolder}",
"skipFiles": [
"<node_internals>/**"
],
"remoteRoot": "usr/src/app",
"protocol": "inspector"
},
On click on play green button nothing happens. VS code version 1.70.2.
I am using windows 10.

Can we run BotiumCLI-WebdriverIO in a headful mode and (or) Selenium Grid? If yes, can how can we modify the Botium.json to achieve this?

I am using Botium-CLI and WebdriverIO connector. I am unable to find any documentation which explains how to run the driver in headful mode (its headless by default) and also how can we modify the botium.json to trigger execution in Selenium Grid. I tried use this, didn't work :
"WEBDRIVERIO_OPTIONS": {
"capabilities": {
"browserName": "chrome"
}
"protocol": "http",
"host": "localhost",
"port": "4444",
"path": "/wd/hub"
}
Please note, I am looking for solutions for Botium CLI, not Botium Box.
With Botium Webdriver Connector, there are basically 4 ways to use Selenium.
As noticed in the question a headless Chrome can be used, see Github docs.
Botium can make use of Selenium Standalone to launch a local Selenium service on test execution, see Github docs. It requires some preparation to install the browser-specific webdrivers.
Botium can connect to your local Selenium server. You can launch your own with the help of Docker - there are instructions available for Botium Box in the Botium Box Wiki, but most of it applies to Botium CLI as well - you you have to configure the Selenium endpoint in the botium.json:
"WEBDRIVERIO_OPTIONS": {
"capabilities": {
"browserName": "chrome"
}
"protocol": "http",
"host": "my-selenium-server",
"port": "4444",
"path": "/wd/hub"
}
Finally, you can also connect to a cloud device service like Saucelabs - every provider with a public Selenium endpoint should work. Parameters are to be given in the botium.json:
"WEBDRIVERIO_OPTIONS": {
"capabilities": {
"deviceName": "Samsung Galaxy S6 GoogleAPI Emulator",
"platformName": "Android",
"platformVersion": "7.0",
"browserName": "Chrome",
"__browserName": "chrome",
"name": "Banking Chatbot Tests",
"tags": "botium, chatbot",
"username": "xxx",
"accessKey": "xxxxx"
},
"protocol": "https",
"hostname": "ondemand.saucelabs.com",
"port": 443
}

ECONNREFUSED 127.0.0.1:9222 when trying to run Microsoft Office Add-In Debugger

When attempting to run the debugger for the Microsoft Office Add-In Debugger extension for VS Code, I get this error when clicking the 'Play' button:
I have seen this question asked multiple times before for Chrome, but nothing specifically for Microsoft Office Add-Ins.
I have tried:
Restarting VS Code and restarting my machine
Running netstat -an | find /i "listening" to view which ports are listening on my machine, and tried replacing port 9222 with each of these ports for the "port" value in launch.json
Tried updating the port key to target port 4200, (the port which my application is hosted on, https://localhost:4200)
Verifying that the webRoot is the correct path.
Removing the port key in launch.json entirely
For reference, I am running this web add-in in Outlook native on Windows 10 version 1903.
From what I can tell, my launch.json seems okay:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch index.html",
"type": "office-addin",
"request": "launch",
"file": "${workspaceRoot}/index.html",
"browserTarget": "Edge"
},
{
"name": "Launch localhost with sourcemaps",
"type": "office-addin",
"request": "launch",
"url": "http://localhost/mypage.html",
"sourceMaps": true,
"webRoot": "wwwroot",
"webviewTarget": "Edge"
},
{
"type": "office-addin",
"request": "attach",
"name": "Attach to Office Add-ins",
"port": 53483,
"trace": "verbose",
"url": "https://localhost:4200/index.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0",
"webRoot": "${workspaceFolder}/app",
"timeout": 45000
}
]
}
I've walked through the documentation here several times but no luck. Does anyone have any idea on how to get around this so that I can run the debugger for my Outlook web Add-In?
If you worked this out, please come back here and post an explanation so you can help us, as well as us helping you.
Note: you need to tag your office-js questions with office-js (that's what the Office JS Microsoft employees listen to and reply on)
Meanwhile - this workaround seems useful to me:
Put this into your taskpane.html:
<textarea id="out" rows=10 cols=46>debug info here</textarea>
And then instead of using console.log() you can use something like this:-
document.getElementById("out").value += "Ready...\n";
Also - it looks like you can install DevTools and the old EdgeHTML engine (by installing JavascriptBrowser) as per my comments here: Can someone from Microsoft please write a working instruction for how to debug Microsoft-365 Apps now-days (post-August-2021)

How to show source code when debugging node against a remote process

I have a nodejs app running in docker container in Linux. I am using VSCode in Windows 10 to remotely debug it. I successfully connect to the container and VSCode accurately displays remote logs in Debug Console. If I manually add a 'debugger' statement in the node code (in published docker image) I get the correct break in VSCode. Then, and only then, can I add dynamic breakpoints to ONLY that js file.
The "LOADED Scripts" does not show/stream any other programs to my VSCode session. The only thing I see are VMxxxxx scripts which are compressed, unreadable and unusable for adding breakpoints.
How do I get the code to stream down? I understand it is read-only and that's all I care about.
My launch.json file contains the following config:
{
"type": "node",
"request": "attach",
"name": "Attach to Remote QA",
"port": 9229,
"address": "11.222.333.444",
"localRoot": "${workspaceFolder}",
"remoteRoot": "/opt/myApp",
"protocol": "inspector",
"sourceMaps": true
}
Thanks in advance for any assistance.
Rob
The config MUST include:
{
"type": "node",
"request": "attach",
"name": "Attach to Remote QA",
"port": 9229,
"address": "11.222.333.444",
"localRoot": "${workspaceFolder}",
"remoteRoot": "//opt//myApp//",
"protocol": "inspector",
"sourceMaps": false,
"init": "what-you-need-here-to-watch"
}

##[error]ResourceNotFound: The Resource 'Microsoft.Web/sites/xx' under resource group 'yy' was not found in deploying ARM template

I am getting resource not found in resource group error while deploying arm template.Could someone help
please .Below is the sample template used:
{
"name": "[variables('AppName')]",
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"kind": "app",
"location": "xx",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"httpsOnly": true,
"clientAffinityEnabled": false,
"serverFarmId": "xx"
},
"resources": [
{
"name": "appsettings",
"type": "config",
"apiVersion": "2016-08-01",
"properties": {
xx:xx
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('AppName'))]",
"[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'),'xx')]",
"[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'),'xx')]",
"[resourceId('Microsoft.KeyVault/vaults/secrets', variables('keyVaultName'),'xx')]"
]
}
]
},
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2016-08-01",
"name": "[concat(variables('AppName'), '/web')]",
"location": "xx",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('AppName'))]"
],
}
Let me know is this the right way to do
its hard to tell without having the exact template and all the variables\parameters, but generally it means one of the following:
wrong name used for the resources that depend on the webapp somewhere
wrong location used for the resources that depend on the webapp somewhere
dependsOn isn't setup properly and it doesnt wait for the webapp and attempts to create a resource in parallel with the web app
Have you ever use the same ARM template to deploy succeed?
Also kindly check if you could directly use script to deploy locally successful without using Azure DevOps. This will help to narrow down the issue.
##[error]ResourceNotFound: The Resource 'Microsoft.Web/sites/xx' under resource group 'yy' was not found in deploying ARM template
This error indicate Resource Manager needs to retrieve the properties for a resource, but can't find the resource in your subscriptions.
You could give a try with below solution:
Solution 1 - check resource properties
Solution 2 - set dependencies
Solution 3 - get external resource
Solution 4 - get managed identity from resource
Solution 5 - check functions
More details please take a look at our official doc here-- Resolve resource not found errors