Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error: Refused to execute script from 'http://localhost:8001/js/mustache.js' because its MIME type (

Pavol-OracleSep 18 2018 — edited Sep 18 2018

Hello,

we would like to use CEC Content SDK from Oracle JEt mobile app to render content items from CEC in our mobile app and we have the following issue:

I have downloaded the Content.min.js and using it as contentSDK (making a reference to location).

// create a ContentDeliveryClient and output logging 'info' messages to the console

                            var contentClient = contentSDK.createDeliveryClient({

                                'contentServer': 'https://devcecs-dhlexpsmrtrpoc.cec.ocp.oraclecloud.com',

                                'channelToken': '490d24532106f1a70b364e5254968be5',

                                'logger': {

                                    info: function (message) {

                                        console.log(message);

                                        console.log('message for success createDeliveryClient'); Working

                                    }

                                }

                            });

                            contentClient.getItem({

                                'id': 'COREC4AC1037291C476EBA6EF448593DF0C4'

                            }).then(

                                function (data) {

                                    // now the data is retrieved, render the layout

                                   console.log('Success Content render' +JSON.stringify(data)); Working

//It fails from here, where I try to Render the content:

                                   contentClient.renderItem({

                                                'data': data,

                                                'layout': 'News', //News is content layout Id

                                                'container': document.getElementById('test') //test is a div in html ( where I want to show the template content)

                                            }).then(

                                                function () {

                                                    // render complete

                                                    console.log('layout added to the page');

                                                },

                                                function (error) {

                                                    console.log('error rendering layout onto the page: ' + JSON.stringify(error));

                                                }

                                            );

                                        },

                                function (error) {

                                    console.log('Error getting data: ' + error);

                                  

                                }

                            );

I get following error:

Refused to execute script from 'http://localhost:8001/js/mustache.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

error rendering layout onto the page: "failed to get layout: contentLayoutPath215953138published/News/assets/render with error: Error: Script error for \"mustache\", needed by: contentLayoutPath215953138published/News/assets/render\nhttp://requirejs.org/docs/errors.html#scripterror"

Regards

Pavol

Comments
Post Details
Added on Sep 18 2018
1 comment
501 views