-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: ionic upload adds malformed UTF-8 BOM to index.html and changes Content-Security-Policy tag #562
Comments
I am also seeing this. This breaks my application every time when using Ionic Upload and Ionic View. |
Same here |
@KerryRitter and @softBarbarian can you guys paste the output of your |
@mhartington Why not me? |
I'll just assume that you hate me because I complained about the UX on the Ionic issue collector. Sorry! 😄 It says Windows 8.1 but it's actually Windows 10.
|
@waynebloss We know you are on Windows 10. We love you! However, we're having trouble recreating this on OSX. @waynebloss Do you have your editor open with index.html when you run |
@jbavari Thanks! I am planning on setting up my OS X box for Ionic one of these days anyway, so I'll try doing that right now and see what happens. |
@waynebloss That'd be awesome. We'd really appreciate it! |
@jbavari I also updated my bad observation from earlier. It did not add a tag-close slash, it removed one. Admittedly, it's HTML5 and I should be able to have that self-closing tag there if I want, but I've seen problems with other tools because of them, so I should be avoiding them anyway, particularly for |
OK, I can totally reproduce this on OS X. Here is the ionic info:
And here is the diff after running diff --git a/src/www/index.html b/src/www/index.html
index ae34b24..dc4bd42 100644
--- a/src/www/index.html
+++ b/src/www/index.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
@@ -7,7 +7,7 @@
<title></title>
<!-- Ionic -->å
<link href="css/ionic.app.css" rel="stylesheet">
- <link href="css/style.css" rel="stylesheet" />
+ <link href="css/style.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ng-cordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script> I'll be glad to let you look at my project or remote into my machine (I use TeamViewer). There's nothing proprietary in it yet, but it's not public so just let me know where to send it (not an email, because it's kind of a big repo with images ~15MB) |
@waynebloss What editor do you use? Do you have it specify UTF-8? |
I have used Visual Studio, Notepad++ and nano to edit the html files in this project. All of the other html files in my project are UTF-8 without BOM, however the |
I'll remove the BOM and try it again on OS X to see if that makes a difference. |
OK, I removed the BOM and diff --git a/src/www/index.html b/src/www/index.html
index 0d0de0a..ff434d0 100644
--- a/src/www/index.html
+++ b/src/www/index.html
@@ -7,7 +7,7 @@
<title></title>
<!-- Ionic -->
<link href="css/ionic.app.css" rel="stylesheet">
- <link href="css/style.css" rel="stylesheet" />
+ <link href="css/style.css" rel="stylesheet">
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ng-cordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script> |
@jbavari It's working on Windows now too. The difference between today and the last time that I tried this is that I have since updated Ionic. So, looks like |
I was just cleaning up my files and I see exactly what is happening now - if the file has a BOM, |
Final note - It turns out that Visual Studio Tools for Apache Cordova projects keep wanting to save So, I reported that one to Microsoft as well. Thanks. |
I'm getting this too on OS X using Adobe Dreamweaver CC 2015, and it's only for single-quote characters in the |
hey, still experiencing this issue
|
me too for both Cordova CLI: 5.4.1 |
Whoa! Just submitted my first ever Pull Request. :) just a minor change, but it seems to have fixed my upload and package issue. hope it helps someone else. |
I am experiencing the same issue as @lincolnberryiii regarding the Content-Security-Policy issue. System information: This issue appears similar to #452 |
@mhartington |
This is still happening on Windows 10 - Visual Studio 2015. |
Hi People, Cordova CLI: 6.1.1 I usually work with InteliJ WebStorm and Notepad++. I also get the same issue while uploading directly with the Windows command-line. Any suggestion? |
Ok, people. A classmate has found a workaround for this problem. It doesn't fix it, but at least the file is correctly uploaded to IonicView and the app works properly:
Steps 3 to 5 must be made as quickly as possible. It seems that this way index.html is uploaded without the malformed code and so it works. Hope this helps someone. |
This should be fixed in the latest version of the CLI. Let us know if you're still having issues, thanks! |
Also it's thanks to @jarodms6 🎉 👏 🎉 |
From @waynebloss on August 12, 2015 1:38
Type: bug
Platform: all
After I ran
ionic upload
for my project, it changed the top of myindex.html
file from this:to this:
index.html
is already encoded in UTF-8 without BOM and it didn't change any of the other files which are encoded the same way. So, I have a few questions:index.html
or any other html file have a BOM?This is on Windows 10. I can try it on OS X and other various Unixes too, but I'll see what shows up here first. Thanks.
Copied from original issue: ionic-team/ionic-framework#4220
The text was updated successfully, but these errors were encountered: