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.

Integration with Typescript (TSX)

See original GitHub issue

I am trying to use pug in my Typescript React components like your basic example:

render() {
    return pug`
      div
        h1 My Component
        p This is my component using pug.
    `;
  }

The problem is that I can’t get it to work because the typescript loader fails on the pug command. However, to use babel, the Typescript files first have to be compiled to javascript. Can anyone help me get out of this Catch-22?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:11
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
param-fkcommented, Jun 7, 2018

Never mind, it is working now.

2reactions
prugecommented, Nov 2, 2020

I publish a library to solve this problem. webpack-preprocessor-pug-tsx

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: Documentation - JSX
JSX is an embeddable XML-like syntax. It is meant to be transformed into valid JavaScript, though the semantics of that transformation are ...
Read more >
How to use TypeScript with React: A tutorial with examples
Using TypeScript with React can increase development speed, improve code readability, and much more. Learn how to get yourself going.
Read more >
Getting Started with React and TypeScript
With React's focus on creating a fantastic user interface and TypeScript's ability to type check our code, it's never been easier to sanely ......
Read more >
Using TypeScript with React
TypeScript is awesome. So is React. Let's use them both together! Using TypeScript allows us to get the benefits of IntelliSense, as well...
Read more >
Getting Started With React and TypeScript Integration
Next, rename the files to become a TypeScript file (e.g. src/index.js to src/index.tsx ) and restart your development server!
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