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.

glimmer-babel preset failing for typescript files

See original GitHub issue

given:

import Component, { hbs } from '@glimmerx/component';

import HelloWorld from './components/HelloWorld.hbs';

export default class App extends Component {
    static template = hbs`
        <HelloWorld />
   `
}

error:

image

once I’m console.log(HelloWorld), everything works just fine, looks like plugin should count .hbs, .gbs extensions

given:

import Component, { hbs } from '@glimmerx/component';

import HelloWorld from './components/HelloWorld.hbs';
console.log(HelloWorld);
export default class App extends Component {
    static template = hbs`
        <HelloWorld />
   `
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
josemarluedkecommented, Oct 12, 2021

I believe that the TS removing the imports also prevents template imports to work in ember with TS. So, fixing support for TS would be the best approach instead of not having TS support at all.

0reactions
lifeartcommented, Oct 2, 2022

@knownasilya with latest TS compiler, new flag introduced, to not delete “not used” imports. It should help (but i’m did not tryied)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Using Babel with TypeScript
This technique is a hybrid approach, using Babel's preset-typescript to generate your JS files, and then using TypeScript to do type checking and...
Read more >
babel/preset-typescript
This is so that we know that the import is not a type import, and should not be removed. allExtensions. boolean , defaults...
Read more >
Upgrading from 1.x - ember-cli-typescript
Update ember-cli-typescript. Follow the detailed upgrade guide below to fix discrepancies between Babel and TypeScript's compiled output.
Read more >
Code-Splitting - React
Most React apps will have their files “bundled” using tools like Webpack, ... For that you will need @babel/plugin-syntax-dynamic-import.
Read more >
Prettier - Code formatter - Visual Studio Marketplace
JavaScript · TypeScript · Flow · JSX · JSON ... You can use VS Code settings, prettier configuration files, or an .editorconfig file....
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