My js files are empty when running on Win10 Azure VM - javascript

I started a Win10 Azure VM with VS 2015 and launched my MVC app using IIS. The js scripts appear to resolve; the paths generated by the bundles all appear legit, but the code isn't visible from the F12 dev tools and I get "'$' is undefined" on my first in-page jQuery call, meaning the jQuery reference, among others, didn't resolve. The browser (Edge, IE, ...) has javascript enabled. Is there some Windows settings that's blocking the resolution of these scripts?
Edit 1
The bundles load correctly if running in IIS Express. I need this to run in IIS though. In order to get MS Account integration I have to have a hosts entry to spoof my site as a www...com address. I tried to get that to work in IIS Express before and had no luck.

Turns out the pre-packaged installation of IIS didn't have "Static Content" enabled.

Related

Excel Javascript Add-in Deployment On Local Network

I have developed an Excel Javascript Add-in on my machine using the yeoman generator. The add-in itself works fine when I start it up on my client with npm start. I can use the add-in on any port I want provided I change all the ports in the config files etc. However, we now want to delpoy this add-in on our local server to make it available to several users.
I have noticed that every time I change the location of the project e.g. from my machine to the server the application will start up but Excel will give me the error message "ADD-IN ERROR Sorry, we can't load the add-in. Please make sure you have network and/or Internet connectivity. Click "Retry" once you are back online". My work around for now is to create a new app on the server and copy the html, js and css file to the taskpane folder. When I now start up the new app it'll work fine.
For the second issue I haven't found a solution/understood the behaviour. When I create an app with the yeoman generator on our server (MS server 2019) and start it up it can be reached via e.g. localhost:3000 on the server but not via :3000 or :3000. It runs fine when I access it from the server itself.
I have opened the inbound and outbound port 3000 on the server to allow https communication. In a next step I added the manifest to the windows 365 admin console and added myself as user. When I open Excel from my machine (client side) the excel add-in will be available in the insert ribbon but won't load and I get the same error message as described above "ADD-IN ERROR Sorry, we can't load the add-in. Please make sure you have network and/or Internet connectivity. Click "Retry" once you are back online"
The following troubleshooting steps have been performed. I checked whether I can reach the add-in url via web browser but the connection timed out. When I check on the server side whether the app is listening I get the below result.
TCP 127.0.0.1:3000 0.0.0.0 Listening 40776
I'm not sure but I think the app should list on e.g. 0.0.0.0:3000 to capture inbound traffic from the client side. Is there a way to change this add-in (app) behaviour on the server when creating/starting up the app with the yeoman generator? I have checked the webpack.config.js file but I couldn't find any way to change that behaviour.
Any idea/help is appreciated.
Thanks!
I believe this is precisely the intended configuration of the yeoman development environment. It spins up the webpack dev (NodeJS) server, which by default only listens to the localhost / loopback address.
From here:
https://webpack.js.org/configuration/dev-server/#devserverhost
It looks like you could hand modify your webpack.config.js file to include a
host: '0.0.0.0' entry under the devServer listing.
The other item you might need to change is
https://webpack.js.org/configuration/dev-server/#devserverallowedhosts
As I believe this defaults to 'auto' which would only allow connections from the local computer.

PWA. Local development with webpack

I'm working with the React Create App and implementing PWA features. I configured PWA manifest successfully, the app can be installed. Now I'm working on Offline mode and here is a problem.
For local development, CRA uses webpack dev server. The app runs on http://localhost:3000
When I add the app to my Desktop and turn off the internet and the webpack dev server I'm facing the error: The webpage at http://localhost:3000/index.html might be temporarily down or it may have moved permanently to a new web address.
It looks like it doesn't work without the working server, eg. a connection.
So I can't test the PWA features because it just doesn't work in a Standalone Mode without any connection (internet & webpack dev server) but I have to.
Is it possible to handle it somehow? Or I'm doing something wrong?
Basically my question is: How to the PWA Offline mode locally in a Standalone mode when PWA installed on Homescreen and the Internet and Dev server are turned off.
Thanks for any help!
Kind Regards.

Getting a 404 error when trying to setup WebStorm IDE JavaScript debugger for a create-react-app

When following an article entitled, "Debugging React apps created with Create React App in WebStorm", the Debugger says it's connected to the JetBrains IDE Chrome Extension, but I can't get breakpoints to execute when using port 3000 and when I try to use the default debug port 63342 a 404 error is shown.
Here is a recording of my settings in Chrome and Webstorm 2016.2 IDE when trying to debug: http://recordit.co/MQ3LICuUIc
Steps Taken:
I've created a new JS debug configuration with the name 'ERS React Debug', the browser set to Chrome, and I've tried using the following URLs in the configuration:
http://localhost:3000/
http://localhost:3000/ers_react/public/index.html
http://localhost:63342/ers_react/public/index.html
(YT video I watched used the debug port, which is what is in my recording)
I also setup the mapping to webpack:///src as recommend in the article.
Default ReactJS app created with create-react-app is designed to be hosted on webpack server started with react-scripts start, that builds the application and starts the server. You won't be able to open this application on the simple built-in webserver (localhost:63342).
To be able to debug modern React app, you need upgrading Webstorm to the most recent version - debugging will work out of the box. Fot Webstorm 2016.2, you can try specifying URL mappings... For "react-scripts": "1.0.17", it should be http://localhost:3000/static/js/full/path to project, like http://localhost:3000/static/js/C:/WebstormProjects/untitled if the project path is C:/WebstormProjects/untitled should work:
Note that you would need to refresh the browser page to get breakpoints in code executed on pagfe loading hit

Meteor: Hot Code Push broken on Android in production

Edit: It works on iOS, the problem is therefore limited to Android.
I just found out, that in my Meteor production app, Hot Code Push is broken. I don't know when it started to occur, but here are the facts (in no particular order):
When I upload new binaries to Google Play/iOS App Store a new version is downloaded by all devices
When I update the server only, the Android App does not update, even when manually forcing a window.location.reload() in the app.
After the server update, in the browser the app reloads as it should be (to the new version)
https://myapp.com/__cordova/manifest.json is served as it should be
I am using mup 1.3.5 on the server
In development mode (on localhost) Hot Code Push works perfectly
When using git checkout on an older commit and building the app locally via meteor run android-device --mobile-server https://myapp.com I can see the following console output:
Download failure
com.meteor.webapp.WebAppException: Error downloading asset manifest
at com.meteor.webapp.AssetBundleManager$1.onFailure(AssetBundleManager.java:97)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.net.ProtocolException: Expected ':status' header not present
at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:266)
at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:149)
at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)
at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)
at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)
at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)
at okhttp3.RealCall.getResponse(RealCall.java:241)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
at okhttp3.RealCall.access$100(RealCall.java:30)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
... 4 more
Download failure
com.meteor.webapp.WebAppException: Error downloading asset manifest
at com.meteor.webapp.AssetBundleManager$1.onFailure(AssetBundleManager.java:97)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:140)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.net.ProtocolException: Expected ':status' header not present
at okhttp3.internal.http.Http2xStream.readHttp2HeadersList(Http2xStream.java:266)
at okhttp3.internal.http.Http2xStream.readResponseHeaders(Http2xStream.java:149)
at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)
at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)
at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)
at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)
at okhttp3.RealCall.getResponse(RealCall.java:241)
at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
at okhttp3.RealCall.access$100(RealCall.java:30)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
... 4 more
"Error: Error downloading asset manifest", source: http://localhost:12128/packages/webapp.js?hash=e448c6ebb2384292f7c97e676471a51951a04169 (71)
This suggests that some kind of :status header is missing for the asset manifest. How can I fix this?
I had this exact same problem with the same console error logs. Using Meteor 1.6.1 and mup 1.4.3. In the end I fixed it by upgrading the cordova-plugin-meteor-webapp with:
meteor add cordova:cordova-plugin-meteor-webapp#1.6.0
and then redeploying. Then hot code push worked on Android!
Edit: To give more background - I think the problem is caused by a problem with okhttp and HTTP/2 on certain version of nginx. See this question. The updated cordova-plugin-meteor-webapp plugin uses a newer version of okhttp.

Meteor app suddenly no longer runs on iOS

My Meteor-based app no longer works as designed on iOS, without me having changed anything relevant. The app still works when run from a local server (http://localhost:3000) as well as when hosted at meteor.com. But, in an iOS simulator and when deployed to an iOS device through xCode, the app fails to run properly.
The app opens with a form that needs to be filled in by the user. When submitting the form, on iOS, the entered values briefly are stored in session variables, but almost immediately the session variables are emptied and the form is displayed again. (What should happen is for an external JSON file to be loaded, based on the form values, after which the contents of that JSON file is manipulated and displayed.)
I just now upgraded to the latest version of Meteor, and xCode did an upgrade itself in the background.
The app is supposed to load a Google font file (from fonts.googleapis.com), but though this works fine when the app is served from either the localhost or meteor, the font does not appear to be loaded when the app runs on iOS.
I'm sorry I don't have actual example code (the whole app?) or a running version of the app that I can show you. As the app is not yet publicly available, I'm a bit reluctant to publish it here. :(
Is there a way to meaningfully debug a Meteor app running on iOS? Is there something obvious I'm missing in the deployment?
Turns out there's an issue with meteor 1.0.4 and building a project using Cordova (https://github.com/meteor/meteor/issues/3814).
I downgraded to meteor 1.0.3 through:
meteor update --release 1.0.3
Then, I deleted the Cordova folder in .meteor/local/ with
rm -R cordova-build
Then, I patched 1.0.3 to 1.0.3.2 with
meteor update --patch
This solved the problem.

Categories