firebase hosting with react build or public? - firebase-hosting

I want to host my react app build folder in to firebase hosing but my app re initialization
changed some stuff in my settings .. how to make firebase hosing send my build folder to the cloud ?
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},

Related

Firebase Cors issue for remote js files

So basically there is a host app which is gets remote microfrontend files from another firebase url.
So remote app is hosted on firebase such as www.firebas-ipsum.web.app.
When host application tries to get file www.firebas-ipsum.web.app/remoteEntry.js as expected we received CORS error.
How can we enable CORS for fetching any files?
I tried solution in CORS issue but it is for requests, not for files.
Found solution by adding headers to firebase.json.
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{
"source": "**/**",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
]
}
}
For more information Offical Docs

Azure DevOps Server 2019: Custom Dashboard Widget not available

We have a self-hosted Azure DevOps Server 2019 for which I have created my own widget using the tutorial https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-dashboard-widget?view=azure-devops-2019.
I was also able to successfully add the extension to the server and the extension is also visible.
However, when I edit my dashboard, my newly created widget is not displayed. What could be the reason for this?
Furthermore, I also installed the extension VstsDashboardWidgetProjectTemplate (https://github.com/GregTrevellick/VstsDashboardWidgetProjectTemplate) in Visual Studio and also created an extension/widget from it. Unfortunately with the same result that I can install and see the extension, but not the actual widget.
I am attaching the vss-extension.json file as I suspect this is where the error is most likely to be found. However, I can also supply the other files if needed.
{
"manifestVersion": 1,
"id": "MyVeryFirstCustomExtension",
"version": "1.0.0",
"name": "My Very First Custom Extension",
"description": "Samples containing different widgets extending dashboards",
"publisher": "MyCompany",
"categories": [
"Azure Boards"
],
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"icons": {
"default": "img/logo.png"
},
"contributions": [
{
"id": "HelloWorldWidget",
"type": "ms.vss-dashboards-web.widget",
"targets": [
"ms.vss-dashboards-web.widget-catalog"
],
"properties": {
"name": "Hello World Widget",
"description": "My first widget",
"catalogIconUrl": "img/CatalogIcon.png",
"previewImageUrl": "img/preview.png",
"uri": "hello-world.html",
"supportedSizes": [
{
"rowSpan": 1,
"columnSpan": 2
}
],
"supportedScopes": [
"project_team"
]
}
}
],
"files": [
{
"path": "hello-world.html",
"addressable": true
},
{
"path": "sdk/scripts",
"addressable": true
},
{
"path": "img",
"addressable": true
}
],
"scopes": [
"vso.work"
]
}

sources assets files in js-debug missing with visual studio code on Apache Royale

I use visual studio code and setup it following theses instructions :
https://github.com/apache/royale-asjs/wiki/Visual-Studio-Code
Everythings worked fine.
For now I deleted bin folder in main project, and when launch debug, then bin and js-debug and others stuffs are right generated, but my assets dir with used jpg are not copied.
For exemple in the code I use <j:Image src="assets/logo.png" percentHeight="100"/> but the is no assets/logo.png in js-debug. So I must copy it manualy...
Here is my asconfig.json :
{
"compilerOptions": {
"targets": [
"JSRoyale"
],
"theme": "${royalelib}/themes/JewelTheme/src/main/resources/defaults.css",
//"html-template": "src/main/resources/jewel-example-index-template.html",
"source-map": true,
"source-path": [
"src"
],
},
"files":
[
"src/main/royale/App.mxml"
]
}
and tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "actionscript",
"clean": true,
"problemMatcher": []
},
{
"label": "build",
"type": "actionscript",
"debug": true,
"problemMatcher": []
}
]
}
Could someone tell me how to copy assets folder automatically ?
thanks
Regards
Add to your asconfig.json file:
"copySourcePathAssets": true

Unable to add Firebase Dynamic Links to a project using a custom domain

I've created Firebase Dynamic Links in other projects before using the page.link URL prefix (the only option at the time). However that no longer appears to be an option when enabling Dynamic Links for a new project today. It looks like the docs for custom domains were updated today. Unfortunately, while they provide some helpful examples, they don't explain how to resolve my issue in a way that I can understand.
So this message seems to indicate that I need to "Put links under a subpath". It seems to me that adding the /link path prefix here should accomplish that? But after making that change, I get the same error message.
It looks like you already have content served on this Hosting site. Put links under a subpath to avoid conflicts with existing content.
I order to try to work around this, I went to my project and added the suggested Hosting configuration and deployed it.
firebase.json:
{
"hosting": {
"public": "dist",
"ignore": [
"**/.*"
],
"appAssociation": "AUTO",
"rewrites": [
{
"source": "/link/**",
"dynamicLinks": true
},
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Even after waiting an hour, I keep getting the same error and I don't understand what to do.
Note that I have the rewrite to /index.html because I have an Angular Single Page Application hosted at www.devintent.com.
No matter what I do, I keep getting this error and the Continue button stays disabled. I tried using my naked domain devintent.com instead of www.devintent.com, but that didn't help. I tried using links.devintent.com, but got the same error.
If I manually remove disabled from the Continue button, then I get this error message:
This links to the docs for manually configuring hosting for dynamic links which has some steps that I've already completed. Clicking the Check Again button just takes me back to the same error in the first image above.
Workaround to not use Custom Domains
I'm happy at this time to use a page.link link, I just need to create a Dynamic Link and get unblocked on this task, but I can't figure out any way in the console to allow me to do that either.
Update on this: I figured out that I needed to add the subdomain to the page.link URL. The tooltip says "or a free Google-provided domain (for example, yourapp.page.link)" at the end. This is a little less prominent that I would have liked (as I didn't find it for quite a long time). Using devintent.page.link works for me as a workaround for now.
However, I'm not sure why the Custom Domain configuration didn't work and why it would be the default if there are such complications with projects with existing Hosting configurations and custom domains.
I had the same issue and got the same error. The problem was that I was redirecting all the routes to index.html. The solution was to restrict the routes to index.html by exclusion.
"rewrites": [
{
"source": "/link/**",
"dynamicLinks": true
},
{
"source": "!/link/**",
"destination": "/index.html"
}
]
After deploying the new configuration to Firebase Hosting, I was allowed to use mydomain.example/link as desired.
I had a similar problem with the root (apex) domain. Basically, if the prefix (the apex domain in my case) is a URL that gives 200 status response, it won't be accepted. In my case the there was an index.html file inside the public folder. I renamed it to something else and it worked.
Here's my firebase.json:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"appAssociation": "AUTO",
"rewrites": [ { "source": "/**", "dynamicLinks": true } ]
}
}
Everything you are doing looks correct with regards to getting your custom domain working. I am wondering if you are using the latest version of firebase-tools (CLI). Custom Domain support for dynamic links was added in version 6.5.0.
Good news is that page.link support still exists but is not as obvious in the new UI flow. The way to get a page.link domain is to start typing your desired subdomain and a suggestion should pop up in the UI. I have included a screenshot to show how this would work.
Adding page link domain image
Hope this helps,
Jeff
For us the issue was that we we're using the default Firebase Hosting site for serving our web-app at all routes ("/**"). Serving our web-app from a different domain that dynamic links is the way it should be for us, since links should not interfere with the web-app.
To serve links from a different domain than our web-app, I created a new site just for links and attached our custom domain to that site. Now we have two Firebase Hosting sites. The first default one for our web-app and the second one for Firebase Dynamic Links.
After this setting up Dynamic Links with a custom domain attached to the second Firebase Hosting site worked flawlessly.
See the screenshot for more details:
EDIT1: the web-app's firebase.json as requested by #cocacrave:
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"function": "nuxtApp"
}
]
}
}
If you are getting this error with subdomain, this solution worked for me:
{
"hosting": [
{
"target": "app",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"appAssociation": "AUTO",
"rewrites": [
{
"source": "/**",
"destination": "/index.html"
}
]
},
{
"target": "links",
"public": "build",
"ignore": [
"**"
],
"appAssociation": "AUTO",
"redirects": [
{
"source": "/",
"destination": "{{your domain}}",
"type": 302
}
],
"rewrites": [
{
"source": "/**",
"dynamicLinks": true
}
]
},
{
"target": "invite",
"public": "build",
"ignore": [
"**"
],
"redirects": [
{
"source": "/",
"destination": "{{your domain}}",
"type": 302
}
],
"appAssociation": "AUTO",
"rewrites": [
{
"source": "/**",
"dynamicLinks": true
}
]
}
]
}
"appAssociation": "AUTO",
"rewrites": [
{
"source": "/page/**",
"destination": "/index.html"
},
{
"source": "/link/**",
"dynamicLinks": true
}
]
It works! I guess the error caused by the original config of "source":"**". May be the range is too large? Though doc say "/__/*" have high priority. (https://firebase.google.com/docs/hosting/full-config?authuser=0#hosting_priority_order)

Firebase: Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key

After upgrading my Firebase project, I got this warning message when deploying my project to Firebase hosting.
Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key.
Anyone has the same problem? How can I fix this?
You just need to modify your firebase.json file which I assume looks somewhat like this:
{
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
You need to move the different keys specified (in this case, public, ignore and rewrites key) to the hosting key so the snippet above would look like below.
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Check out this link for more info on Firebase hosting deployment configuration.