Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup failed to resolve import #148

Open
rexkenley opened this issue Jul 18, 2024 · 3 comments
Open

Rollup failed to resolve import #148

rexkenley opened this issue Jul 18, 2024 · 3 comments

Comments

@rexkenley
Copy link

I am getting a "rollup failed to resolve import" error. Can you please show me what I did wrong?

vite.config.ts
image

tsconfig.app.json
image

tsconfig.json
image

tsc -b returns ok

When I run vite build, I get the error.
image

@achimstraussdmb2bcom
Copy link

achimstraussdmb2bcom commented Aug 7, 2024

same problem. Problems since upgrade of typescript from 5.4.x to 5.5.x.

My tsconfig:

{
	"compilerOptions": {
		"composite": true,
		"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
		"skipLibCheck": true,
		"module": "ESNext",
		"moduleResolution": "bundler",
		"allowSyntheticDefaultImports": true,
		"strict": true,
		"noEmit": true,
		"baseUrl": "./src",
		"paths": {
			"pages/*": [
				"pages/*"
			],
			"contexts/*": [
				"contexts/*"
			],
			"components/*": [
				"components/*"
			],
			"services/*": [
				"services/*"
			],
			"hooks/*": [
				"hooks/*"
			],
			"i18n/*": [
				"i18n/*"
			],
			"operations/*": [
				"operations/*"
			],
			"src/*": [
				"*"
			]
		}
	},
	"types": [
		"vitest/globals"
	],
	"include": ["vite.config.ts"]
}

@codethief
Copy link

codethief commented Aug 13, 2024

I can't get it to work, either, but switching back to TypeScript 5.4.2 doesn't seem to fix it @achimstraussdmb2bcom. FWIW, since I make extensive use of extends and TSC project references, which has been causing issues in many other tools¹, I also tried explicitly setting projects / configNames to the tsconfigs that actually contain the path aliases, and I also tried enabling parseNative. But nothing has worked so far.

¹) EDIT: I see that vite-tsconfig-paths actually takes projects references into account, so I think my suspicion is unjustified and the issue must be elsewhere.

@aleclarson
Copy link
Owner

Add a minimal reproduction to test fixtures (see other fixtures for guidance) and submit a PR. I will take a look then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants