require-handlebars-plugin icon indicating copy to clipboard operation
require-handlebars-plugin copied to clipboard

Loading templates from relative paths

Open jkroso opened this issue 12 years ago • 9 comments

I get an error when I use relative paths to load templates with the same name as a JavaScript module. The template itself actually loads fine though it just does some more stuff afterwards which throws this.

Uncaught Error: Load timeout for modules: hbs!../src/SelectBox_unnormalized2,hbs!../src/SelectBox

I can fix this by changing the name of the template or using absolute paths. Thought this problem should probably be mentioned in the docs.

jkroso avatar Oct 26 '12 00:10 jkroso

Mobile right now, but are you using require 2.1.1?

SlexAxton avatar Oct 26 '12 00:10 SlexAxton

Yea just updated both the plugin and requirejs

jkroso avatar Oct 26 '12 00:10 jkroso

I am having this problem also. If I do an optimized build it works fine though. That makes debugging a little more difficult however

papodaca avatar Nov 13 '12 02:11 papodaca

Are you using windows?

On Tue, Nov 13, 2012 at 3:03 PM, Ethan Apodaca [email protected]:

I am having this problem also. If I do an optimized build it works fine though. That makes debugging a little more difficult however

— Reply to this email directly or view it on GitHubhttps://github.com/SlexAxton/require-handlebars-plugin/issues/68#issuecomment-10312945.

Regards, Jakeb

jkroso avatar Nov 13 '12 02:11 jkroso

Yes, I am serving my project with a local wamp stack if that matters.

papodaca avatar Nov 13 '12 02:11 papodaca

So am I. I've been having tons of trouble lately with file paths through node.

jkroso avatar Nov 13 '12 03:11 jkroso

Ok, I solved this. I had the handlebars code in the json2.js file. Make sure the dependencies are correct. You can try stepping through the hbs.js file in the browser to see what is going wrong and check the import variables are set correctly JSON may be null or something else.

papodaca avatar Nov 13 '12 19:11 papodaca

Thanks

On Wed, Nov 14, 2012 at 8:40 AM, Ethan Apodaca [email protected]:

Ok, I solved this. I had the handlebars code in the json2.js file. Make sure the dependencies are correct. You can try stepping through the hbs.js file in the browser to see what is going wrong and check the import variables are set correctly JSON may be null or something else.

— Reply to this email directly or view it on GitHubhttps://github.com/SlexAxton/require-handlebars-plugin/issues/68#issuecomment-10339835.

Regards, Jakeb

jkroso avatar Nov 13 '12 19:11 jkroso

Whilst it make not be the issue you were having, I came to this issue when trying to resolve the problem I had with my naming convention/directory structure - see #128.

rapidrapids avatar Aug 10 '13 20:08 rapidrapids