This repository has been archived by the owner on Jul 6, 2021. It is now read-only.
next-typescript uses ts-loader again #306
Comments
Yeah this is a pretty big limitation with the babel transpilation which I also hit, and they can't fix it. Would be nice to be able to choose whether to use ts-loader or babel. |
Would this work for you?
|
@sorenhoyer It does not work... |
To be possible to re-export some interfaces using next-typescript, should use ts-loader again, but I think it is difficult. https://github.com/jagaapple/next-tsc Thank you. |
@jagaapple – cool workaround, but unfortunately that makes compilation take so long that the HMR client times out waiting for the hot update. Sigh. |
Next.js will have typescript support by default soon. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Babel 7 supports TypeScript transpilation, Next.js 7 and latest
next-typescript
use Babel 7, but the limitation creates breaking changes.On large project, developers create
index.js
(orindex.ts
) to encapsulate the API calls from the web app into a single folder like the following.Babel 7 does not support these re-export types and throw some warnings. (For more detail: babel/babel#8361 (comment))
Currently, Next.js 7 block HMR when some warnings are shown (For more detail: vercel/next.js#5429). This means TypeScript developers creating
index.ts
cannot use HMR. Even if the HMR blocking issue is solved, Babel 7 throws re-export warnings.So
next-typescript
should use ts-loader instead of Babel (@babel/preset-typescript
) because ts-loader does not throw warnings and block HMR.The text was updated successfully, but these errors were encountered: