Closed
Description
➜ vite-import-tsc git:(main) npx tsc -p .
➜ vite-import-tsc git:(main) /Users/maxschmitt/Developer/tmp/typescript-go/built/local/tsgo -p .
vite.config.ts:17:10 - error TS2305: Module '"/Users/maxschmitt/Developer/tmp/vite-import-tsc/node_modules/vite/index"' has no exported member 'defineConfig'.
17 import { defineConfig } from 'vite';
~~~~~~~~~~~~
Found 1 error in vite.config.ts:17
➜ vite-import-tsc git:(main)
Reproduction: https://github.com/mxschmitt/typescript-go-issue-vite-defineConfig-types.git
tsc works while tsgo does not.
Commit: 5cae442
Extracted minimal reproduction from #895.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jrmyio commentedon May 23, 2025
Possibly related to #518
tsgo
typechecking error in tsx code that passes when usingtsc
#921Andarist commentedon Jun 19, 2025
Does the issue persist with the recent builds? I can't repro it
wojtekmaj commentedon Jun 19, 2025
It does not!
mxschmitt commentedon Jun 19, 2025
Closing as fixed - Thanks!
Marsup commentedon Jun 20, 2025
I'm personally still seeing it on 7.0.0-dev.20250620.1.
EDIT: it looks like it happens on project configured in commonjs or with commonjs set as module in tsconfig. It seems to only be fixed if the module system is set as ESM for both the project and tsconfig.
smaccoun commentedon Jun 20, 2025
Was fixed for me about a week ago and I've been routinely updating. Not sure what PR fixed it but has been good for me
Andarist commentedon Jun 20, 2025
@Marsup please provide a repro case so somebody could investigate further
Marsup commentedon Jun 20, 2025
Here it is: https://github.com/Marsup/typescript-go-issue-904
Just run
npm ci && npm test