Webpack + React and Google Chrome 43.0.2357.65 - javascript

After updating Google Chrome (v. >= 43.0.2357.65) error was displayed in console: Uncaught SyntaxError: Unexpected token function in different places of my bundle.js.
It appears only when bundle.js returns 200 http status. But after refresh page this file returns 304 http status and all works fine without errors. I'm using webpack v.1.8.5 and React v.0.13.2
In other browsers code works fine, and in Google Chrome before update it works fine.

See this Chrome issue and this related Twitter conversation from the person who filed it.
If you're using an older version of Node.js in your build, updating it might fix this. From the issue:
broken.js was the result of a build script running in Node.js 0.10.18, which seems to have written the file with some peculiar character encoding issues

Related

Cypress runner gives me a 404 when using Firefox browser

This issue seems somewhat related to Cypress.io: Server Error | 404 - File or director not found but the solution provided did not work for me.
I can run my tests in Cypress runner fine with Chrome, Electron and Edge but when I attempt to run a test in Firefox I'm getting a 404. I'm using FF 86
I enabled experimentalSourceRewriting in my cypress.json file but it's still failing.
The issue was with Zscaler and some scripts that were changing the Firefox proxy.

Unhandled JS Exception: Unexpected token '<' no stack

I started facing an issue with running my react native application in iOS device
Unhandled JS Exception: Unexpected Token '<' no stack
This started happening after i generated the main.jsbundle in react native application using the below curl command
curl http://localhost:8081/index.ios.bundle -o main.jsbundle
and added this file in xcode project. This seems to like an issue with parsing of the main.jsbundle file which i added in react-native.
Prior to the above process i tried running the application with localhost:8081 for finding the jsbundle but doesn't help me for ios devices. Code in my develop branch is working fine, but same develop code in my feature branch doesn't work with main.jsbundle.
Did anyone faced similar issue with running react native code in iOS devices.
The response you're getting is most likely in HTML format, which starts with a <. When you try to parse this response (presumably with res.json()) an exception is thrown, because a json string cannot start with a <
Try debugging your program and check exactly what the response you're getting is

Failed to Load Resource In Production but Not Locally

I am working on a Django project and I have it deployed on pythonanywhere.com. In my project, I am using Django Jsignature which works fine on my local machine. In production, however, when I load the particular template, I get this error in my console - 'myurl' portion is not the real url.
https://myurl.com/static/js/jSignature.min.js net::ERR_ABORTED 404 (Not Found)```
So I don't get this locally, but do in Production. Can anyone suggest for me where to start on this? I'm not even really sure where to begin, it's my first time deploying anything.
EDIT
you can see the details of django jsignature here: https://pypi.org/project/django-jsignature/
the {{form.media}} should load this script.
UPDATE 2
This is no longer working locally either. Here are the error in my console.
Uncaught SyntaxError: Invalid or unexpected token jSignature.min.js:70
Uncaught TypeError:
$(...).jSignature is not a function

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.

What is causing my "illegal character in input string" exception with Facebook PHP SDK when deploying to Heroku?

"facebook/php-sdk-v4" : "4.0.*" - resolves to 4.0.15
Javascript SDK v2.2
I'm having an issue when deploying my laravel app to Heroku using the latest JS SDK and PHP SDK.
It works perfectly locally (nginx) but when deployed to Heroku (Apache) it fails here:
$helper = new FacebookJavaScriptLoginHelper();
with exception -
iconv_strlen(): Detected an illegal character in input string
Logs with both local and remote cookies look the same (structurally), so it's not that:
[fbsr_75710##########] => dJPP8B2GrKYHLmM8826lLXsjclHexnHv4V-dooUISI0.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI...........
I ran into the same issue. If you look at the full stack trace you will see that mb_strlen is used before iconv and returns a bad result; turns out that on Heroku, the mbstring extension is not enabled by default. You need to manually request it in your composer.json, in the "require": bit:
"ext-mbstring": "*"
Update, push and it should work for you. Bit of a late answer but hopefully this will be helpful for anyone running into the same issue.

Categories