Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Getting Uncaught Error: failed to require template #629

Closed
aprilb opened this issue Mar 13, 2015 · 11 comments
Closed

Getting Uncaught Error: failed to require template #629

aprilb opened this issue Mar 13, 2015 · 11 comments

Comments

@aprilb
Copy link
Contributor

aprilb commented Mar 13, 2015

Getting this error in the debugging console when attempting to require a template.

My component.json with:

  "templates": [
    "template.hbs"
  ]

the index.js where it is being required:

Tried this

MyScript.prototype.template = require("./template");
MyScript.prototype.template = require("./template.hbs");

Both result in an error.

@sankargorthi
Copy link
Member

I ran into this too - I was running a --standalone build. Is that how you're using component too? @aprilb

Also, are you using a plugin for handlebars or pre-compiling them yourself?

@timaschew
Copy link
Member

  • what is the error?
  • how your build output looks?
  • how you build your app?
  • do you use the hbs plugin and if yes, how?

@aprilb
Copy link
Contributor Author

aprilb commented Mar 13, 2015

Error:

Uncaught Error: failed to require "./template.hbs"

@aprilb
Copy link
Contributor Author

aprilb commented Mar 13, 2015

@sankargorthi using component-build-handlebars plugin

@sankargorthi
Copy link
Member

@aprilb are you using a custom builder? How's the plugin parsing your templates? Also, which version of the plugin and component are you using?

@aprilb
Copy link
Contributor Author

aprilb commented Mar 13, 2015

Here is the build file:
https://gist.github.com/aprilb/aedad66feec4236f1982

Versions:
"component": "~1.0.0",
"component-build-handlebars": "0.0.1",

@aprilb
Copy link
Contributor Author

aprilb commented Mar 13, 2015

@sankargorthi
Copy link
Member

Everything looks good to me so far. And you aren't using the standalone builder either - so no idea why your template's not loading.

@timaschew
Copy link
Member

why you use also the string plugin?
https://gist.github.com/aprilb/aedad66feec4236f1982#file-gistfile1-txt-L58

the readme of the handlebars plugin don't mention the string plugin, so it looks like you using it wrong.

@aprilb
Copy link
Contributor Author

aprilb commented Mar 13, 2015

Removing the string plugin doesn't seem to have an affect --still getting the same error. But the person who wrote the handlebars plugin I mentioned --also wrote this part of the script. It doesn't fail if these scripts are local --they are only failing now that they are being required as a remote dependency.

@timaschew
Copy link
Member

If you want help, please provide a repository where I can reproduce the problem.

@aprilb aprilb closed this as completed Mar 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants