-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
requirejs build failure #216
Comments
What is your require.js configuration and directory structure? |
I'm having a similar issue trying to build my app. Getting this error when trying to build: RequireJS Config: /*global requirejs */
requirejs.config({
baseUrl: '',
paths: {
jquery: ['../bower_components/jquery/dist/jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery'],
backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore',
slick: '../bower_components/slick.js/slick/slick',
velocity: '../bower_components/velocity/velocity',
hbs: '../bower_components/require-handlebars-plugin/hbs',
handlebars: '../bower_components/require-handlebars-plugin/hbs/handlebars',
PortfolioView: 'js/views/PortfolioView',
ProjectView: 'js/views/ProjectView',
PortfolioCollection: 'js/models/PortfolioCollection',
ProjectModel: 'js/models/ProjectModel'
},
shim: {
slick: ['jquery'],
velocity: ['jquery']
},
hbs: {
helpers: false,
i18n: false,
templateExtension: 'mu',
partialsUrl: 'views/templates'
}
}); Directory Structure (trimmed a bit for clarity):
And here's the file where I'm using the hbs plugin: define([
'backbone',
'hbs!templates/_project',
'jquery'
], function(Backbone, ProjectTemplate, $) {
// more code here
}); |
Running in to the same issue. At first blush it seems like an issue with having a file called @adamgruber did you ever find a solution? edit: |
i'm seeing something similar. using grunt-contrib-requirejs 0.4.4 |
You have to rename hbs.js to something else. That fixed for me. |
@luos i have no hbs.js file. perhaps the hbs plugin is failing to load? |
it seems the hbs.js file was not being copied although the hbs dir was. i'm not familiar enough with requirejs to say why this would occur. |
this issue appears to be resolved in a newer version of requirejs. i saw the problem under 2.1.11 but its gone under 2.1.16 @mduman can you confirm? |
i lied. its still there. i think the problem is that there is both an hsb dir and hbs file. the problem is only shown when the content for this project is outside your base dir |
my bower content is not within my requirejs base directory, therefore the build fails due to the following lines of code. the fix - don't have hbs.js and the hbs dir.
|
I took another look at this but still no luck. Definitely seems to be an issue with the mix of hbs.js and the hbs directory. At this point I'm looking into precompiling templates using a gulp task and requiring that file. |
after some further investigation i think the best solution is to make hbs.js rely on externally available modules rather than attempt to supply its own. it would also be good to reduce the number of dependencies - the i18n bits should be removed and reliance on underscore could be refactored out. Handlebars would still need to be supplied. |
Hello,
i could not manage to build my app with r.js. (it works fine witjhout build)
versions:
"requirejs": "~2.1.15",
"handlebars": "~2.0.0",
"require-handlebars-plugin": "~0.11.1"
Could you help about the below error message please?
[18:19:08] Error: Error: ENOENT, no such file or directory 'B:_prod\app\hbs.js'
In module tree:
modules/book
modules/book/views
The text was updated successfully, but these errors were encountered: