blitz-js / blitz-js/blitz

blitz install errors if you use the --js arg on blitz new

Open
#2,470 4 comments 0 reactions 0 assignees View on GitHub
kind/bug status/ready-to-work-on
Dominant language
TypeScript
Stars
14.1k
Forks
803
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

As the title says, if you use the --js argument when initializing a new project, blitz install fails since it can't compile the recipes with Typescript.

### Paste all your error logs here:

```
TSError: ⨯ Unable to compile TypeScript:
.blitz/recipe-install/index.ts:2:8 - error TS1259: Module
'"/home/ollie/Desktop/dev/test/.blitz/recipe-install/node_modules/@types/jscodeshift/index"' can only
be default-imported using the 'esModuleInterop' flag

2 import j from "jscodeshift"
~

.blitz/recipe-install/node_modules/@types/jscodeshift/index.d.ts:11:1
11 export = core;
~~~~~~~~~~~~~~
This module is declared with using 'export =', and can only be used with a default import when using
the 'esModuleInterop' flag.
```

### Paste all relevant code snippets here:

```
blitz new test --js
blitz install tailwind
```

### What are detailed steps to reproduce this?

1. Initialize a new project
2. Try to `blitz install tailwind`

### Run `blitz -v` and paste the output here:

```
Linux 5.12 | linux-x64 | Node: v16.2.0

blitz: 0.37.0 (global)
blitz: 0.37.0 (local)

Package manager: yarn
System:
OS: Linux 5.12 Garuda Linux
CPU: (4) x64 Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
Memory: 418.16 MB / 7.56 GB
Shell: 3.2.2 - /bin/fish
Binaries:
Node: 16.2.0 - /usr/bin/node
Yarn: 1.22.10 - /usr/bin/yarn
npm: 7.15.1 - /usr/bin/npm
Watchman: Not Found
npmPackages:
@prisma/client: 2.24.1 => 2.24.1
blitz: 0.37.0 => 0.37.0
prisma: 2.24.1 => 2.24.1
react: 0.0.0-experimental-0eea57724 => 0.0.0-experimental-0eea57724
react-dom: 0.0.0-experimental-0eea57724 => 0.0.0-experimental-0eea57724
typescript: ~4.2 => 4.2.4
```

### Please include below any other applicable logs and screenshots that show your problem:

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.