ion icons not showing up on ipad / edge











up vote
0
down vote

favorite












I have a stenciljs component deployed in an nginx server behind an authentication service. In order to get anything the request must include a cookie containing an access_token. the component is dipslyaed with no preoblem on android devices and on chrome/firfox/IE11/ in desktop devices. the problem is with microsoft edge and on ipad (any navigator) and its due to the browser not sending the cookie to the server. Any hint ?



header.tsx



import { Component, Prop, State, Element } from '@stencil/core';
@Component({
tag: 'pm-header',
styleUrl: 'pm-header.scss',
shadow: true
})
export class PmHeader {

...

render() {
return (
<nav>
<ul>
<li id="menu-icon" class="left menu-icon"
onClick={() => this.toggleFocus('menu-icon')} >
<a>
<ion-icon name="md-apps"></ion-icon>
</a>
</li>
<li id="user-icon" class="right menu-icon"
onClick={() => this.toggleFocus('user-icon')} >
<a>
<ion-icon name="md-contact"></ion-icon>
</a>
</li>
</ul>
</nav>
);
}
}


PS: I'm using stencil/core v0.15.2










share|improve this question
























  • @ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
    – Deepak-MSFT
    Nov 23 at 5:47










  • I posted some code sample, if there is any additional information that I can provide, please tell me :)
    – malek yahyaoui
    Nov 23 at 9:26















up vote
0
down vote

favorite












I have a stenciljs component deployed in an nginx server behind an authentication service. In order to get anything the request must include a cookie containing an access_token. the component is dipslyaed with no preoblem on android devices and on chrome/firfox/IE11/ in desktop devices. the problem is with microsoft edge and on ipad (any navigator) and its due to the browser not sending the cookie to the server. Any hint ?



header.tsx



import { Component, Prop, State, Element } from '@stencil/core';
@Component({
tag: 'pm-header',
styleUrl: 'pm-header.scss',
shadow: true
})
export class PmHeader {

...

render() {
return (
<nav>
<ul>
<li id="menu-icon" class="left menu-icon"
onClick={() => this.toggleFocus('menu-icon')} >
<a>
<ion-icon name="md-apps"></ion-icon>
</a>
</li>
<li id="user-icon" class="right menu-icon"
onClick={() => this.toggleFocus('user-icon')} >
<a>
<ion-icon name="md-contact"></ion-icon>
</a>
</li>
</ul>
</nav>
);
}
}


PS: I'm using stencil/core v0.15.2










share|improve this question
























  • @ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
    – Deepak-MSFT
    Nov 23 at 5:47










  • I posted some code sample, if there is any additional information that I can provide, please tell me :)
    – malek yahyaoui
    Nov 23 at 9:26













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a stenciljs component deployed in an nginx server behind an authentication service. In order to get anything the request must include a cookie containing an access_token. the component is dipslyaed with no preoblem on android devices and on chrome/firfox/IE11/ in desktop devices. the problem is with microsoft edge and on ipad (any navigator) and its due to the browser not sending the cookie to the server. Any hint ?



header.tsx



import { Component, Prop, State, Element } from '@stencil/core';
@Component({
tag: 'pm-header',
styleUrl: 'pm-header.scss',
shadow: true
})
export class PmHeader {

...

render() {
return (
<nav>
<ul>
<li id="menu-icon" class="left menu-icon"
onClick={() => this.toggleFocus('menu-icon')} >
<a>
<ion-icon name="md-apps"></ion-icon>
</a>
</li>
<li id="user-icon" class="right menu-icon"
onClick={() => this.toggleFocus('user-icon')} >
<a>
<ion-icon name="md-contact"></ion-icon>
</a>
</li>
</ul>
</nav>
);
}
}


PS: I'm using stencil/core v0.15.2










share|improve this question















I have a stenciljs component deployed in an nginx server behind an authentication service. In order to get anything the request must include a cookie containing an access_token. the component is dipslyaed with no preoblem on android devices and on chrome/firfox/IE11/ in desktop devices. the problem is with microsoft edge and on ipad (any navigator) and its due to the browser not sending the cookie to the server. Any hint ?



header.tsx



import { Component, Prop, State, Element } from '@stencil/core';
@Component({
tag: 'pm-header',
styleUrl: 'pm-header.scss',
shadow: true
})
export class PmHeader {

...

render() {
return (
<nav>
<ul>
<li id="menu-icon" class="left menu-icon"
onClick={() => this.toggleFocus('menu-icon')} >
<a>
<ion-icon name="md-apps"></ion-icon>
</a>
</li>
<li id="user-icon" class="right menu-icon"
onClick={() => this.toggleFocus('user-icon')} >
<a>
<ion-icon name="md-contact"></ion-icon>
</a>
</li>
</ul>
</nav>
);
}
}


PS: I'm using stencil/core v0.15.2







ipad microsoft-edge stenciljs ionicons






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 at 7:51

























asked Nov 22 at 15:45









malek yahyaoui

377




377












  • @ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
    – Deepak-MSFT
    Nov 23 at 5:47










  • I posted some code sample, if there is any additional information that I can provide, please tell me :)
    – malek yahyaoui
    Nov 23 at 9:26


















  • @ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
    – Deepak-MSFT
    Nov 23 at 5:47










  • I posted some code sample, if there is any additional information that I can provide, please tell me :)
    – malek yahyaoui
    Nov 23 at 9:26
















@ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
– Deepak-MSFT
Nov 23 at 5:47




@ malek, I suggest you to provide a code sample to produce the issue. We will try to produce the issue on our side and try to find any possible solution or a work around. Thanks for your understanding.
– Deepak-MSFT
Nov 23 at 5:47












I posted some code sample, if there is any additional information that I can provide, please tell me :)
– malek yahyaoui
Nov 23 at 9:26




I posted some code sample, if there is any additional information that I can provide, please tell me :)
– malek yahyaoui
Nov 23 at 9:26












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










So after some digging it turned out that the issue is with ionicons implementation.
They fetch the svgs without sending the credentials which result in an authenticated request. Of course some navigator such as chrome and firefox and even IE11 manages to send the cookies even though it's not explicitly specified that they should.
Anyway, to solve this I had to create a script file that run after the build. This script adds credentials: "include" option to the fetch call so that the cookie get sent.



fix-icons-script.js



/** 
* Workaround to fix this ion-icons bug https://github.com/ionic-team/ionicons/issues/640
* To be removed when this bug is fixed
*/
const fs = require('fs');
const workDir = 'dist/component-dir';

fs.readdir(workDir, function(err, items) {
if (err) { return console.log(err); }

for (var i=0; i<items.length; i++) {
if (items[i].endsWith('.entry.js')) {
insertString(workDir + '/' + items[i], '"force-cache"', ',credentials:"include"');
}
}
});

function insertString(file, searchValue, insertValue){
fs.readFile(file, 'utf8', function (err, content) {
if (err) { return console.log(err); }

let newContent = content.substr(0, content.indexOf(searchValue) + searchValue.length);
content = content.substr(newContent.length, content.length);
newContent += insertValue + content;

fs.writeFile(file, newContent, function (err) {
if (err) { return console.log(err); }
console.log('Successfully rewrote ' + file);
});
});
}





share|improve this answer





















  • @ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
    – Deepak-MSFT
    Nov 26 at 3:22










  • Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
    – malek yahyaoui
    Nov 26 at 8:26










  • Thanks for your kind efforts for marking the answer for this thread.
    – Deepak-MSFT
    Nov 26 at 9:47













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434393%2fion-icons-not-showing-up-on-ipad-edge%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










So after some digging it turned out that the issue is with ionicons implementation.
They fetch the svgs without sending the credentials which result in an authenticated request. Of course some navigator such as chrome and firefox and even IE11 manages to send the cookies even though it's not explicitly specified that they should.
Anyway, to solve this I had to create a script file that run after the build. This script adds credentials: "include" option to the fetch call so that the cookie get sent.



fix-icons-script.js



/** 
* Workaround to fix this ion-icons bug https://github.com/ionic-team/ionicons/issues/640
* To be removed when this bug is fixed
*/
const fs = require('fs');
const workDir = 'dist/component-dir';

fs.readdir(workDir, function(err, items) {
if (err) { return console.log(err); }

for (var i=0; i<items.length; i++) {
if (items[i].endsWith('.entry.js')) {
insertString(workDir + '/' + items[i], '"force-cache"', ',credentials:"include"');
}
}
});

function insertString(file, searchValue, insertValue){
fs.readFile(file, 'utf8', function (err, content) {
if (err) { return console.log(err); }

let newContent = content.substr(0, content.indexOf(searchValue) + searchValue.length);
content = content.substr(newContent.length, content.length);
newContent += insertValue + content;

fs.writeFile(file, newContent, function (err) {
if (err) { return console.log(err); }
console.log('Successfully rewrote ' + file);
});
});
}





share|improve this answer





















  • @ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
    – Deepak-MSFT
    Nov 26 at 3:22










  • Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
    – malek yahyaoui
    Nov 26 at 8:26










  • Thanks for your kind efforts for marking the answer for this thread.
    – Deepak-MSFT
    Nov 26 at 9:47

















up vote
0
down vote



accepted










So after some digging it turned out that the issue is with ionicons implementation.
They fetch the svgs without sending the credentials which result in an authenticated request. Of course some navigator such as chrome and firefox and even IE11 manages to send the cookies even though it's not explicitly specified that they should.
Anyway, to solve this I had to create a script file that run after the build. This script adds credentials: "include" option to the fetch call so that the cookie get sent.



fix-icons-script.js



/** 
* Workaround to fix this ion-icons bug https://github.com/ionic-team/ionicons/issues/640
* To be removed when this bug is fixed
*/
const fs = require('fs');
const workDir = 'dist/component-dir';

fs.readdir(workDir, function(err, items) {
if (err) { return console.log(err); }

for (var i=0; i<items.length; i++) {
if (items[i].endsWith('.entry.js')) {
insertString(workDir + '/' + items[i], '"force-cache"', ',credentials:"include"');
}
}
});

function insertString(file, searchValue, insertValue){
fs.readFile(file, 'utf8', function (err, content) {
if (err) { return console.log(err); }

let newContent = content.substr(0, content.indexOf(searchValue) + searchValue.length);
content = content.substr(newContent.length, content.length);
newContent += insertValue + content;

fs.writeFile(file, newContent, function (err) {
if (err) { return console.log(err); }
console.log('Successfully rewrote ' + file);
});
});
}





share|improve this answer





















  • @ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
    – Deepak-MSFT
    Nov 26 at 3:22










  • Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
    – malek yahyaoui
    Nov 26 at 8:26










  • Thanks for your kind efforts for marking the answer for this thread.
    – Deepak-MSFT
    Nov 26 at 9:47















up vote
0
down vote



accepted







up vote
0
down vote



accepted






So after some digging it turned out that the issue is with ionicons implementation.
They fetch the svgs without sending the credentials which result in an authenticated request. Of course some navigator such as chrome and firefox and even IE11 manages to send the cookies even though it's not explicitly specified that they should.
Anyway, to solve this I had to create a script file that run after the build. This script adds credentials: "include" option to the fetch call so that the cookie get sent.



fix-icons-script.js



/** 
* Workaround to fix this ion-icons bug https://github.com/ionic-team/ionicons/issues/640
* To be removed when this bug is fixed
*/
const fs = require('fs');
const workDir = 'dist/component-dir';

fs.readdir(workDir, function(err, items) {
if (err) { return console.log(err); }

for (var i=0; i<items.length; i++) {
if (items[i].endsWith('.entry.js')) {
insertString(workDir + '/' + items[i], '"force-cache"', ',credentials:"include"');
}
}
});

function insertString(file, searchValue, insertValue){
fs.readFile(file, 'utf8', function (err, content) {
if (err) { return console.log(err); }

let newContent = content.substr(0, content.indexOf(searchValue) + searchValue.length);
content = content.substr(newContent.length, content.length);
newContent += insertValue + content;

fs.writeFile(file, newContent, function (err) {
if (err) { return console.log(err); }
console.log('Successfully rewrote ' + file);
});
});
}





share|improve this answer












So after some digging it turned out that the issue is with ionicons implementation.
They fetch the svgs without sending the credentials which result in an authenticated request. Of course some navigator such as chrome and firefox and even IE11 manages to send the cookies even though it's not explicitly specified that they should.
Anyway, to solve this I had to create a script file that run after the build. This script adds credentials: "include" option to the fetch call so that the cookie get sent.



fix-icons-script.js



/** 
* Workaround to fix this ion-icons bug https://github.com/ionic-team/ionicons/issues/640
* To be removed when this bug is fixed
*/
const fs = require('fs');
const workDir = 'dist/component-dir';

fs.readdir(workDir, function(err, items) {
if (err) { return console.log(err); }

for (var i=0; i<items.length; i++) {
if (items[i].endsWith('.entry.js')) {
insertString(workDir + '/' + items[i], '"force-cache"', ',credentials:"include"');
}
}
});

function insertString(file, searchValue, insertValue){
fs.readFile(file, 'utf8', function (err, content) {
if (err) { return console.log(err); }

let newContent = content.substr(0, content.indexOf(searchValue) + searchValue.length);
content = content.substr(newContent.length, content.length);
newContent += insertValue + content;

fs.writeFile(file, newContent, function (err) {
if (err) { return console.log(err); }
console.log('Successfully rewrote ' + file);
});
});
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 at 15:47









malek yahyaoui

377




377












  • @ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
    – Deepak-MSFT
    Nov 26 at 3:22










  • Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
    – malek yahyaoui
    Nov 26 at 8:26










  • Thanks for your kind efforts for marking the answer for this thread.
    – Deepak-MSFT
    Nov 26 at 9:47




















  • @ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
    – Deepak-MSFT
    Nov 26 at 3:22










  • Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
    – malek yahyaoui
    Nov 26 at 8:26










  • Thanks for your kind efforts for marking the answer for this thread.
    – Deepak-MSFT
    Nov 26 at 9:47


















@ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
– Deepak-MSFT
Nov 26 at 3:22




@ malek, From your last post. i can see that you had found the solution for your issue and posted it as an answer. I suggest you to mark that answer as an accepted answer for this question may help other community members in future. thanks for your understanding.
– Deepak-MSFT
Nov 26 at 3:22












Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
– malek yahyaoui
Nov 26 at 8:26




Tried to do it when I posted the answer but it wasn't possible until 24h after the answer is posted, thanks for reminding me :)
– malek yahyaoui
Nov 26 at 8:26












Thanks for your kind efforts for marking the answer for this thread.
– Deepak-MSFT
Nov 26 at 9:47






Thanks for your kind efforts for marking the answer for this thread.
– Deepak-MSFT
Nov 26 at 9:47




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434393%2fion-icons-not-showing-up-on-ipad-edge%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What visual should I use to simply compare current year value vs last year in Power BI desktop

How to ignore python UserWarning in pytest?

Alexandru Averescu