question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_input.charCodeAt is not a function

See original GitHub issue

When the website attempts to load the inspector shows the following error: Uncaught TypeError: this._input.charCodeAt is not a function

Here is my webpack config loader statement:

        {test: /\.pug$/, loader: 'pug-loader'},

I am new to webpack, so it may very well be me. I was able to get pug-html-loader working, but would rather stick with the folks that created pug. If it is of any importance, I am using this in an Angular2 app.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

5reactions
fklinglercommented, Nov 11, 2016

Unlike pug-html-loader, the require('file.pug') method does not return a string of the html.

It returns a template function (as indicated, maybe not clearly enough, in the README). This function takes a “locals” object as parameter, so you can pass it variables that are handled in the pug template. Since Angular2 components already handle these variables, you don’t have to pass any object, but you still have to call the template function to get the html string, hence the require('file.pug')() syntax.

To have consistency with other loaders, I think it would be great to have an option the loader query to get the string directly instead of the template function.

3reactions
fklinglercommented, Nov 10, 2016

You have to use this syntax:

@Component({
    template: require('./home.component.jade')()
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: str.charCodeAt is not a function - Stack Overflow
I updated to node version 6 today and that might've broke something. I tried to get back to node 5.10 but the issue...
Read more >
TypeError: this.input.charCodeAt is not a function · Issue #3089
Exception has occurred: TypeError TypeError: this.input.charCodeAt is not a function at Parser.
Read more >
charcodeat is not a function javascript, typeerror
The charCodeAt() method returns the Unicode of the character at the specified index in a string. The index of the first character is...
Read more >
String.prototype.charCodeAt() - JavaScript - MDN Web Docs
If index is not a number, it defaults to 0 . Return value. A number representing the UTF-16 code unit value of the...
Read more >
t.charcodeat is not a function - You.com | The AI Search ...
This could be an issue with some module not being entirely compatible with newer versions of node.js or could just be a bug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found