I'm struggling to get TypeScript working with v2. The exported functionality which comes out of the box has a number of issues which are getting flagged. My IDE also complains about these when using standard JS but I can disable the inspection.
npx @docusaurus/init@next init website
Rename pages/index.js to index.tsx.
I'm getting import errors, such as:
TS2307: Cannot find module '@docusaurus/useDocusaurusContext'.TS2307: Cannot find module '@theme/Layout'.I can see within node_modules everything seems to be within the @docusaurus directory, but the exported types don't seem to be working.
Can someone point in in the right direction? Happy to start some docs, but I'm not entirely sure where to start.
@Ehesp this issue should be fixed in v2.0.0-alpha.54. Please use that version. Sorry for that.
Sort of fixed - the @theme ones work, not the @docusaurus ones (see PR)
Latest version works, thanks.
@lex111 I still get this error with 2.0.0-alpha.58
@SebastianM I successful resolved this error on the current public 58th alpha version flowing the steps below:
specify the new version of @docusaurus/module-type-aliases package explicitly at the first step:
npm i -D @docusaurus/module-type-aliases@next ...other
install @types/react if you use react hooks
Most helpful comment
@SebastianM I successful resolved this error on the current public 58th alpha version flowing the steps below:
specify the new version of
@docusaurus/module-type-aliasespackage explicitly at the first step:install
@types/reactif you use react hooks