`microbundle-crl` uses old version of TS incompatible with template literal types
See original GitHub issueWhat 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:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
WorkAround
And my build worked.
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.