npm create t3-app@latestを実行するとすでにエラーが出てしまっている

実現したいこと

前提

t3 stacksの勉強をしようと思い

zsh

1 npm create t3-app@latest

を実行したところtailwind.config.tsでエラーが出てしまっている。

環境

  • windows wsl2 ubuntu20.04.2LTS

発生している問題・エラーメッセージ

vscodeでsatisfiesとConfigの部分が赤いラインが出ておりそれぞれにカーソルを合わせた時に表示されるメッセージ

any ';' が必要です。ts(1005) 名前 'satisfies' が見つかりません。ts(2304) any 'Config' は型のみを参照しますが、ここで値として使用されています。ts(2693)

該当のソースコード

typescript:

1import type { Config } from "tailwindcss";2 3export default {4 content: ["./app/**/*.{js,jsx,ts,tsx}"],5 theme: {6 extend: {},7 },8 plugins: [],9} satisfies Config;

json:package.json

1{2 "name": "t3-todo-app",3 "version": "0.1.0",4 "private": true,5 "scripts": {6 "build": "next build",7 "dev": "next dev",8 "postinstall": "prisma generate",9 "lint": "next lint",10 "start": "next start",11 "prepare": "husky install"12 },13 "dependencies": {14 "@next-auth/prisma-adapter": "^1.0.5",15 "@prisma/client": "^5.0.0",16 "@t3-oss/env-nextjs": "^0.3.1",17 "@tanstack/react-query": "^4.29.7",18 "@trpc/client": "^10.26.0",19 "@trpc/next": "^10.26.0",20 "@trpc/react-query": "^10.26.0",21 "@trpc/server": "^10.26.0",22 "next": "^13.4.2",23 "next-auth": "^4.22.1",24 "react": "18.2.0",25 "react-dom": "18.2.0",26 "react-hot-toast": "^2.4.1",27 "superjson": "1.12.2",28 "zod": "^3.21.4"29 },30 "devDependencies": {31 "@types/eslint": "^8.37.0",32 "@types/node": "^18.16.0",33 "@types/prettier": "^2.7.2",34 "@types/react": "^18.2.6",35 "@types/react-dom": "^18.2.4",36 "@typescript-eslint/eslint-plugin": "6.0.0",37 "@typescript-eslint/parser": "6.0.0",38 "autoprefixer": "^10.4.14",39 "eslint": "^8.40.0",40 "eslint-config-next": "^13.4.2",41 "husky": "^8.0.0",42 "lint-staged": "^13.2.3",43 "postcss": "^8.4.21",44 "prettier": "^2.8.8",45 "prettier-plugin-tailwindcss": "^0.2.8",46 "prisma": "^5.0.0",47 "tailwindcss": "^0.0.0-insiders.7578794",48 "typescript": "^5.1.0"49 },50 "ct3aMetadata": {51 "initVersion": "7.16.0"52 }53}

試したこと

https://github.com/tailwindlabs/tailwindcss/issues/10891

上記のissueを参考に

npm install tailwindcss@latest npm install tailwindcss@insiders.

などを実行しましたがエラーが解決しません。

エラーを見る限りtypescriptがsatisfiesを認識していない感じがするのですが、satisfiesは4.9移行使用できるのでよくわからないです。

また適当なtypescriptファイルに

export const testName = "test" as const satisfies string;

このような記述をするとやはりsatisfies の部分で

typescript

1const satisfies: any2',' が必要です。ts(1005)3変数 'satisfies' の型は暗黙的に 'any' になります。ts(7005)

このようなエラーが出てきます。
npm create t3-app@latestをしただけなのにエラーが出てきて困っています。
回答のほう鎧くお願いします。

コメントを投稿

0 コメント