2

I added some js files which were exported from Adobe Muse to my wwwroot/js folder. However, when I check the console, it doesn't look like these folders can be found.

I am calling the scripts using:

    <script src="~/js/require.js?crc=4157109226" type="text/javascript" async data-main="~/js/museconfig.js?crc=4153641093" onload="if (requirejs) requirejs.onError = function(requireType, requireModule) { if (requireType && requireType.toString && requireType.toString().indexOf && 0 <= requireType.toString().indexOf('#scripterror')) window.Muse.assets.check(); }" onerror="window.Muse.assets.check();"></script>

The errors I'm getting are below:

enter image description here

And finally I have my folders set up as follows

enter image description here

1 Answer 1

4

data-main attribute is read by requirejs and not by Razor engine. That is why requirejs being a JavaScript library will not be able to resolve ~ in the path. Use Url.Content for that, like below.

data-main="@Url.Content("~/js/museconfig.js")"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.