简体   繁体   中英

Ember issue: Uncaught Error: Could not find module handlebars

index.html :

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Let's learn Ember.js</title>
        <script src="jquery-1.10.2.js"</script>
        <script src="handlebars-1.1.2.js"</script>
        <script src="ember-1.5.1.js"</script>
        <script>
            window.App = Ember.Application.create();
        </script>
    </head>
    <body>
        <script type="text/x-handlebars" data-template-name="index">
            <h1>Welcome to Ember.js!</h1>
        </script> 
    </body>
</html>

jquery, handlbars and ember are in the same folder as index.html .

When I opened index.html in the Chrome (the address line of the browser looks: file:///home/askar/work/ember/emberjs/index.html ), In the Console tab of Inspect Element I'm getting the error:

Uncaught Error: Could not find module handlebars ember-1.5.1.js:251
requireModule ember-1.5.1.js:251
(anonymous function) ember-1.5.1.js:27031
(anonymous function) ember-1.5.1.js:27317
(anonymous function) ember-1.5.1.js:44267

What am I doing wrong?

Couldn't find any related posts.

在此处输入图片说明

在此处输入图片说明

It is because your script tags are missing the closing angle brackets.

Try this:

<script src="jquery-1.10.2.js"></script>
<script src="handlebars-1.1.2.js"></script>
<script src="ember-1.5.1.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM