Error in publishing react website on IIS server [works in the local] - node.js

I couldn't run the (asp.net) React.js site in one turn. First of all, I publish the site from Visual Studio to the httpdocs folder on the server. In the image below, you can see the file structure under httpdocs.
Then I set up the node.js as seen in the second picture attached. Here, I specified service-worker.js file as application startup file. But I'm not sure about that. Do you think these settings are correct?
Right now the site returns the error ReferenceError: self is not defined, the source of the error is service-worker.js. All the code works fine on my local computer. I think the error is about the way I configured the node.js. Any help_

Related

Ajax server request failed after published to a local IIS folder

I have published my .net core 7 web application using visual studio 2022 and IIS-10 to my local folder in "inetpub\wwwroot\iddcsw".
I have fully tested my application before publishing them and it's working fine but after published to a local folder and ran
my application, I encountered this server request error from my ajax call and doesn't provide any actual error/exception messages.
I have also check the folder in "FailedReqLogFiles" but nothing is there, no logs at all. When I checked the httperr1 file from the LogFiles folder in system32. I got this
What does this mean? and how to fix this? Any solution for this HTTP Error 500 on my end?
If you know the solution, please let me know. Thank you.

app_artifact_location when the app is internationalized

I'm working with the new Azure Static Web Apps Preview product, not to be confused with Azure Web Apps.
My Angular 9 app, which runs fine locally, is all set up for internationalization, and one effect of the internationalization is that it drops my index.html into app/catfood/dist/en_US rather than app/catfood/dist.
This is leaving me stuck in terms of how to set the app_artifact_location value in the workflow file. If I leave it at the default value of "dist/catfood" the build gives me this error, which honestly does seem accurate as the index.html isn't going to be there:
Failed to find a default file in the app artifacts folder (dist/congruence-web). Valid default files: index.html,Index.html.
If your application contains purely static content, please verify that the variable 'app_location' in your workflow file (located in .github/workflows) points to the root of your application.
If your application requires build steps, please validate that a default file exists in the build output directory.
But if I change it to the logical "dist/catfood/en_US" I get this error:
The app build failed to produce artifact folder: 'dist/catfood/en_US'. Please ensure this property is configured correctly in your workflow file.
Really not sure what the build system is expecting of me. What should I be using for app_artifact_location? Or am I even tweaking the wrong thing here?
Update: When I deliberately turn off i18n in angular.json, the en_US directory goes away and index.html is found in dist/catfood and everything works great. So basically the problem is "Why does Azure Static Web Apps not understand localized Angular applications?"

Getting error of Web Server not configure correnctly while run DotnetNuke Project in VS 2015

I have created a DotnetNuke Project. It is working fine if I import .zip file of it as a Module in DotnetNuke.
But if I run the project in any browser, it keep throws following error. I am trying to get rid since few days but still not get any solution. :(
Unable to start debugging on the web server. The web server is not
configured correctly. See help for common configuration erros. Running
the web page ourside of the debugger may provide further information.
I have configure Start http://dnndev.me/ and Project Url to http://dnndev.me/desktopmodules/MyTest2
Can anybody please suggest me.
After set Debugger = True in web.config file of dnndev.me
First thing to do is open the WEB.CONFIG file in the root of the DNN website and make sure that debug is set to true.

HTTP Error 500.19 - Internal Server Error Cannot read configuration file

I have been searching for this error all over the internet but no matter what I try to fix this problem nothing actually works. And the detailed message that I got after I copied a url from fiddler and put it in the browser and is as follows.
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\C:\inetpub\wwwroot\myservices\web.config
Actually what has happened in the past that I had this service called "myservices" working all fine when I used visual studio to create a virtual directory for it in IIS. But then what I did, I tried to do a web deploy of this service in IIS and removed ("myservices" from Default Web Site tree which I had created by creating a virtual directory from within VS 2013). And what I observed is, that after I web deployed "myservices" it didn't work the same way as it was working previously when (I created a virtual directory for "myservices" in IIS through VS2013 but had it removed to see whether the web deployed version of it would behave the same way). Therefore when I analyzed the cause of HTTP error 500.19 through Fiddler (for the web deployed service) it said (Config Error Cannot read configuration file and
Config File \?\C:\inetpub\wwwroot\myservices\web.config) but when I physically try to look into the folder C:\inetpub\wwwroot I could never find myservices folder as such (what to talk of web.config file in it). Then I manually created a folder called "myservices" in C:\intepub\wwwroot directory and put my web.config file there to see if the web deployed service would still work, but it didn't. Then I removed this folder called "myservices" and obviously the web.config file inside of it and also removed the web deployed service from Default Web Site Tree.
And now after all this mess even if I go to visual studio and try to create a virtual directory for my service "myservices" (I can see it in Default Web Site Tree in IIS ) but it would throw the same error as http 500.19 as the web deployed version of this service. In other words whatever I tried it messed up my services even when it's not a web deployed version which previously was not the case. I literally request everybody out there to please guide/suggest me with whatever experience they have as to what went wrong in all this trial and error endeavor of mine.
Thanks
This may be a long shot, but sometimes web.config files get corrupted (our code repository occasionally does this) and you cannot see it with the naked eye. take a simple web.config file that you know is not corrupt and start rebuilding the file from there if it works. We have also used a hex editor (like XVI32) where we can see the corruption, but its much easier to rebuild from a fresh file.
If your problem is not the web.config but the virtual folders, then do the same methodology. Start over with what works and go from there. It could be the web deploy tool that is causing the corruption.
When nothing worked, all I did, was uninstalled IIS rebooted my machine re-installed it again and the HTTP 500.19 is gone.It seems like my IIS was corrupted.

How to get standard out from a Node.js application in Azure?

We have a Node.js application with a pretty big codebase that we're trying to deploy to an Azure Web Site. My problem is that when I deploy the app and try to access it, I just get a message saying "The page cannot be displayed because an internal server error has occurred".
According to http://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-debug/ I should be able to configure some settings and have my standard out be logged to a file - well, it's not working. in /LogFiles I can see /git, /html, and /DetailedErrors, but none of these folders contain the stdout logs.
I have deployed the app using Visual Studio. I created a blank Azure project, and manually added all the folders and files I need. I also created an iisnode.yml file that contains the following config:
loggingEnabled: true
devErrorsEnabled: true
logDirectory: ./logs
debugHeaderEnabled: true
The last two lines I added later, the first ones are from the tutorial. I also have a web.config file, the contents of which I haven't really touched.
I've attempted to configure the settings that are available in the Web Sites UI, but I haven't really been able to make any headway. I think currently they are pretty much default.
I'm sorry that I can't provide you with more information. I'm really kind of banging my head against the wall here, since all the tutorials I've found basically state that if I do this and that, everything should work. The problem is, it doesn't. Sad face.
Edit: I should probably add that my server.js is in a folder called /NodeServer. It's not in the root as Azure seems to presume.
Edit2: I deployed a Hello World example and got it to work, but when I try to move the server.js file from the root I can't get it to work anymore.
I've added a tag to the web.config, so that the structure is basically
configuration
location path="NodeServer"
system.webServer
I've also edited my package.json so that it says
"main":"NodeServer/server.js",
"scripts":{
"start":"cd NodeServer && node server.js"
}
If the app is started successfully, you should be able to find the stdout at
D:\home\LogFiles\Application
in Azure Websites, without configuring anything.
But here it looks like an error related to incorrect/missing web.config. The node app may not get launched. You can try:
Publishing your app using git to Azure Websites.
Or if you are familiar with IIS and iisnode, make sure your app works locally with IIS and iisnode. See http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
Or try publishing an "hello world" node.js app to Azure Websites, take the generated web.config and modify it for your app.
Edit: When you change the location of server.js, you have to change web.config too. The change in web.config is not correct. And package.json is only used as hints to generate web.config during git deployment. To get your "hello world" to work, you can either
In your web.config, replace all "server.js" with "NodeServer/server.js".
Or deploy the modified app using git. Make sure it does not contain the wrong web.config.
Then you can try to get your larger app to work.

Resources