0

This is very weird because it was all working Friday, and now it doesn't. When my program first starts, it fails on the very first require with "Module name "../common/windward" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded"

test-layout.html:

<script src="../../libs/jquery.js"></script>
<script src="../../libs/es6-promise.js"></script>
<script data-main="test-layout.js" src="../../libs/require.js"></script>

test-layout.js:

var windward = require('../common/windward');

The requireJS manual wants the first require to be:

require(['foo'], function (foo) {
    //foo is now loaded.
});

However, this is the way the typescript compiler creates the .js file (for amd). And it worked 3 days ago.

Is there something else I need to do to get requireJS started?

1 Answer 1

2

this is the way the typescript compiler creates the .js file (for amd).

No. It should generate:

define(["require", "exports", "../common/windward"], function(require, exports, windward) {
});

Something seems to be calling --module commonjs in your pipeline.

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.