Angular6 ServiceWorker dont cache all files - angular6

I generated a clean Angular6 Project and use ng add #angular/pwa i get this ngsw-config.json:
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}
]
}
There is the whole assets folder marked for "Service Worker Caching" But the Sad reality show that this isnt real:
The 3 Graphic files i use ( header-bg.jpg, list-border-red.svg & list-border-green.svg ) Are marked as "from ServiceWorker" But when i create a App on my Smartphone, and disconnect the Internet connection and open the App, is only header-bg.jpg available. but list-border-red.svg & list-border-green.svg are not available offline.
Also shows the graphic thas 2 favicons are loaded from "Disc Cache" and one from the ftp... The files are also in the assets folder, why they are not cached fro mServiceWorker? Is the ServiceWorker stuff maybe bugged in Chrome?
The App is allready Online and can be found here: https://expense-calculator.com/ Just open and make your own tests if you need this to reproduce my problem.

Your service worker code looks good and is registered perfectly to serve the files in offline just as you have expected it to work. I've checked in Chrome with Airplane mode on. All files including .svg files loaded from cache.
Please retry.

Related

"crbug/1173575, non-JS module files deprecated" Error in flutter

i created a json file with all the data required for my app, it was working fine but one image was showing error saying that it is from another domain, so i changed the image address to another image, and now it says
crbug/1173575, non-JS module files deprecated
i tried changing it back to the previous image and restarted the application it still shows the error.
{
"id": 1,
"name": "92.7",
"tagline": "on the ground by Rose",
"color": "blue",
"url": "https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png" ,
"img": "https://preview.redd.it/ls2yuc4501l61.jpg?width=512&auto=webp&s=be785e98bf288f69c0b0105fb2bce6ab807b20f4",
"category": "blackpink",
"disliked": false,
"order": 1
},
{
"id": 2,
"name": "92.7",
"tagline": "blood sweat and tears by BTS",
"color": "blue",
"url":"https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png",
"img":"https://m.media-amazon.com/images/M/MV5BZTQ3YmU4MjAtYzQ0NC00NjRjLThmMzYtMTE4MzgzMWJkNjliXkEyXkFqcGdeQXVyNDY5MjMyNTg#._V1_.jpg",
"category": "BTS",
"disliked": false,
"order": 2
}
Error was in the first pic, the second was showing fine but after changing it , now it doesnt start the application and shows the error i mentioned above. I'm using google chrome to run the application.
Delete your launch.json file as it is causing your app to not launch with the default configuration of flutter
I encounter the same error in one of my flutter web projects. you have to delete the launch.json file.
Here is path of file
.vscode -> launch.json
just delete launch.json and your project will run.
{
// 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": [
{
"request": "launch",
"name": "Launch Chrome against localhost",
"type": "dart"
}
]
}

PhpStorm: what are php-cs-fixer files and how to ignore them

I keep getting "Multiple definitions exist for class..." warnings in PhpStorm, and upon inspection, I see these a bunch of these huge php-cs-fixer files (100K+ lines) with the comment "This file is part of PHP CS Fixer.".
I found that there are multiple copies of several other files named phploc, composer, php-scoper, etc., under vendor/library_name/tools/ in various libraries for some reason. They are all huge compiled files that PhpStorm detects.
I tried ignoring these files in PhpStorm one by one, and once re-indexing finishes, these files disappear, leading me to believe they're IDE-generated files. However, it makes no sense the IDE would generate them and in turn include them hinting code.
composer.json
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"require": {
"magento/composer-root-update-plugin": "~1.0",
"magento/product-community-edition": "2.4.1"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"friendsofphp/php-cs-fixer": "~2.16.0",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": ">=0.12.3 <=0.12.23",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "~5.0.0",
"squizlabs/php_codesniffer": "~3.5.4"
},
"conflict": {
"gene/bluefoot": "*"
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/",
"Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
},
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php",
"app/helper.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/"
}
},
"version": "2.4.0",
"minimum-stability": "stable",
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-force": "override"
}
}
PhpStorm ignored files (adding php-cs-fixer and phploc here somehow removed all/multiple copies from the vendor directories):
These files are in your vendor directory as you must have install your dependencies from sources, not distributions.
Let's use sebastian/code-unit as an example to see how it works:
the file obviously is in the repository: https://github.com/sebastianbergmann/code-unit/tree/1.0.8/tools
but excluded from being exported to distribution (the archive file you are actually downloading from GitHub when installing package): https://github.com/sebastianbergmann/code-unit/blob/1.0.8/.gitattributes#L6 - you can see that it's not present in file you download from https://github.com/sebastianbergmann/code-unit/releases/tag/1.0.8
So, you must have install your dependencies using composer install --prefer-source (or composer update --prefer-source as it's the other command with that option) and you want to use --prefer-dist or actually not using any of these flags as the latter is the default. You can find more information about it in official documentation: https://getcomposer.org/doc/03-cli.md#install-i
Remove your vendor directory and install dependencies once more without --prefer-source flag.
AFAIR there was also an issue when you did not have curl extension installed, then simply add this extension.

Static Tab with placeholder values not displayed

I am currently getting into Microsoft Team Apps and am trying to create a very simple tool.
All it should be is a static tab, that when visited embeds a certain website, that's given the groupId as a parameter. This is the format, that I have in mind for the contentUrl: https://foo.bar?groupId=\{groupId\}
The app consists only of two images, that are PNGs in 20x20px (transparent) and 96x96px (with background color) and the manifest (version 1.2).
The manifest contains all required fields:
$schema, manifestVersion, version, id, packageName, developer {name, websiteUrl, privacyUrl, termsOfUseUrl}, icons {color, outline}, description {short, full}, accentColor, permissions, validDomains, staticTabs [{entityId, name, contentUrl, scopes}]
An Id for the app has been generated at apps.dev.microsoft.com.
The upload of the custom app as zip file causes no error and I can see the app in the list of the installed applications. If I switch to a channel I can't see the tab which should be there without being explicitly added because it's a static tab. Adding it manually isn't possible because it's not shown in the list of "addable apps".
I tried some of the example apps from GitHub, but they seem outdated and at least partly can't be even read (Error while reading manifest.json).
Is this sufficient information to help me?
Edit: (anonymized manifest.json)
{
"$schema":
"https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"version": "1.0.0",
"id": "12345678-abcd-efgh-1234-123456789012",
"packageName": "com.microsoft.teams.bar",
"developer": {
"name": "Foo Corp",
"websiteUrl": "https://foo.com",
"privacyUrl": "https://foo.com/privacy",
"termsOfUseUrl": "https://foo.com/termsofuse"
},
"icons": {
"color": "src/images/waldo-96x96.png",
"outline": "src/images/waldo-20x20.png"
},
"name": {
"short": "bar",
"full": "bar"
},
"description": {
"short": "Opens baz and does qux.",
"full": "Opens baz and does qux."
},
"accentColor": "#FFFFFF",
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["*.baz.com", "*.foo.com"],
"staticTabs": [
{
"entityId": "tabId",
"name": "example tab",
"contentUrl":
"https://foo.com/?teamId={teamId}&teamName={teamName}&channelId={channelId}&channelName={channelName}&locale={locale}&theme={theme}&entityId={entityId}&subEntityId={subEntityId}&upn={upn}&tid={tid}&groupId={groupId}&theme={theme}&isFullScreen={isFullScreen}",
"scopes": ["personal"]
}
]
}
I could see two issues in your manifest code:
Invalid GUID: 12345678-abcd-efgh-1234-123456789012 is not valid GUID.
Icons must be included in the package and referenced via relative paths in the manifest.
ex. waldo-96x96.png - Please place them inside zip file.
Please feel free to use Teams App Studio to create the manifest file. You can also use the existing form the sample code.

How to Debug other project than "main"?

Using Visual Studio Code, I have two directories in my workspace (both node.js projects), but I can only launch one of them. The launch.json file exists in both folders, but only the first is available in debug menu. The launch.json files looks like that:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\app.js",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}
How can I start debugging the second folder of my workspace?
I removed the first folder from the workspace, started the only project left, then added the removed folder again. Now I have both projects in the launch configurations.
I have found two solutions. Both involve editing your *.code-workspace file.
As OP found, you can reorder the folders. In the *.code-workspace file, place the folder with the desired launch.json at the top of the list of folders.
"folders": [
{
"path": "..\\ProjectWithLaunchJson"
},
{
"path": "..\\MyOtherProject"
}
]
Alternatively, you can include the launch configuration in the *.code-workspace file.
"folders": [
:
:
],
"settings": {
"launch": {
"configurations": [
{
<copy your launch.json's configuration into here>
}
]
}
}
YMMV. I had to tweak the path to the executable. And I had to remove the preLaunchTask property since VS Code could not find the Task. VS Code's support for this will likely evolve.

How do you make manifest.json for Microsoft Teams bot?

I followed the online tutorial for constructing a bot in Visual Studio and deploying it Azure, and so far that seems to have worked. Now I want to add this bot to Microsoft Teams via the "Sideload a bot or tab" method. The online tutorial has NO explanation for what I need to do so I need some help. Here is the manifest.json I was currently trying to upload in a zip folder. Please help, I don't know how this process works.
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",
"version": "1.0.0",
"id": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"packageName": "com.testbot20170525114049",
"developer": {
"name": "Megan",
"websiteUrl": "https://website.com/",
"privacyUrl": "https://website.com/privacy",
"termsOfUseUrl": "https://website.com/app-tos"
},
"name": {
"short": "Botty"
}
"description": {
"short": "A sample bot to test the bot upload process"
}
"bots": [
{
"botId": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"needsChannelSelector": "true",
"scopes": [ "team", "personal" ]
}
]
}
Enable Public Developer Preview. The v1.0 manifest is fully supported in that mode, and while it may work in the public version, for now I'd switch to developer preview mode.
Make sure your manifest follows the v1.0 format. While your schema is close, there are a few required fields missing:
description.full
icons.outline
icons.color (note currently there is a 2k limit on file size)
accentColor
Zip the manifest and icons into a sideloadable package. Make sure the manifest.json is at the top level.
Follow the sideload instructions.