oven-sh/bun

bun init react project broken

クローズ

#19,272 opened on 2025/04/25

 (8 件のコメント) (1 件のリアクション) (0 人の担当者)Rust (4,486 件のフォーク)batch import
bugcligood first issue

Repository metrics

Stars
 (90,348 個のスター)
PR merge metrics
 (PR metrics pending)

説明

What version of Bun is running?

1.2.5+013fdddc6

What platform is your computer?

Linux 6.12.21-4-MANJARO x86_64 unknown

What steps can reproduce the bug?

  • Run bun init
  • Select the React, Shadcn + TailwindCSS options
  • Run with bun dev
  • Open the browser at localhost:3000
  • Click the method selector dropdown (GET) Image
  • Open the project in VS Code

What is the expected behavior?

An up and running project with no obvious errors

What do you see instead?

In the editor:

problems

{
	"build.ts": [
		{
			"resource": "/<<redacted>>/bun-init-react/build.ts",
			"owner": "typescript",
			"code": "1378",
			"severity": 8,
			"message": "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.",
			"source": "ts",
			"startLineNumber": 132,
			"startColumn": 3,
			"endLineNumber": 132,
			"endColumn": 8
		},
		{
			"resource": "/<<redacted>>/bun-init-react/build.ts",
			"owner": "typescript",
			"code": "2802",
			"severity": 8,
			"message": "Type 'IterableIterator<string>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.",
			"source": "ts",
			"startLineNumber": 138,
			"startColumn": 25,
			"endLineNumber": 138,
			"endColumn": 64
		},
		{
			"resource": "/<<redacted>>/bun-init-react/build.ts",
			"owner": "typescript",
			"code": "1378",
			"severity": 8,
			"message": "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher.",
			"source": "ts",
			"startLineNumber": 144,
			"startColumn": 16,
			"endLineNumber": 144,
			"endColumn": 21
		}
	],
	"form.tsx": [
		{
			"resource": "/<<redacted>>/bun-init-react/src/components/ui/form.tsx",
			"owner": "typescript",
			"code": "1484",
			"severity": 8,
			"message": "'ControllerProps' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.",
			"source": "ts",
			"startLineNumber": 6,
			"startColumn": 3,
			"endLineNumber": 6,
			"endColumn": 18
		},
		{
			"resource": "/<<redacted>>/bun-init-react/src/components/ui/form.tsx",
			"owner": "typescript",
			"code": "1484",
			"severity": 8,
			"message": "'FieldPath' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.",
			"source": "ts",
			"startLineNumber": 7,
			"startColumn": 3,
			"endLineNumber": 7,
			"endColumn": 12
		},
		{
			"resource": "/<<redacted>>/bun-init-react/src/components/ui/form.tsx",
			"owner": "typescript",
			"code": "1484",
			"severity": 8,
			"message": "'FieldValues' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.",
			"source": "ts",
			"startLineNumber": 8,
			"startColumn": 3,
			"endLineNumber": 8,
			"endColumn": 14
		}
	]
}

In the browser:

Image Image Image

Additional information

The blank and TailwindCSS-only templates work ok

コントリビューターガイド