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.

`microbundle-crl` uses old version of TS incompatible with template literal types

See original GitHub issue

What happens and why it is wrong

I am using microbundle-crl for compiling my React TypeScript Project, compiling the code fails when I am using TypeScript Template Types like export type SpaceThemeProps = `$${keyof typeof theme['space']}` | (string & {})

Error

I get the following error when I run microbundle-crl --no-compress --format modern,cjs - semantic error TS2305: Module '"../../../../stitches.config"' has no exported member 'SpaceThemeProps'.

Versions
npmPackages:
    typescript: ^4.1.5 => 4.1.5

rollup.config.js

`rollup.config.js`:

tsconfig.json

`tsconfig.json`:
{
  "compilerOptions": {
    "outDir": "dist",
    "module": "esnext",
    "lib": ["dom", "esnext"],
    "moduleResolution": "node",
    "jsx": "react",
    "sourceMap": true,
    "declaration": true,
    "esModuleInterop": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "allowSyntheticDefaultImports": true,
    "target": "es5",
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  },
  "include": ["src"],
  "exclude": ["node_modules", "dist", "example", "**/*.stories.tsx"]
}

package.json

`package.json`:

plugin output with verbosity 3

plugin output with verbosity 3:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yaldramcommented, Feb 18, 2021

WorkAround

And my build worked.

0reactions
agilgur5commented, Apr 24, 2022

This is an issue with microbundle-crl, which has not been updated in ~2 years, not this plugin.

microbundle-crl uses an old version of this plugin under-the-hood, but this plugin does not specify a TS version, TS is listed as a peerDep. microbundle-crl, on the other hand, does specify an old TS version, specifically TS v3, before TS v4.

Closing as this is out-of-scope for this plugin and is a downstream issue in microbundle-crl, not here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Template Literal Types not working with string concatenation
You can get concatenation at the type level with a const assertion (as implemented in microsoft/TypeScript#40707), or if the template literal ...
Read more >
rollup-plugin-typescript2 - Bountysource
I am using microbundle-crl for compiling my React TypeScript Project, compiling the code fails when I am using TypeScript Template Types like export...
Read more >
Use microbundle for a TypeScript npm module - Code with Hugo
I've created a GitHub repository template with microbundle, TypeScript, ava and xo. You can find it at github.com/HugoDF/microbundle-ts-pkg/.
Read more >
CLI for Creating Reusable React Libraries - Morioh
Answer some basic prompts about your module, and then the CLI will perform the following steps: copy over the template; install dependencies via...
Read more >
Falcon Sandbox v8.46.1 © Hybrid Analysis
Not all malicious and suspicious indicators are displayed. Get your own cloud service or the full version to view all details.
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