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

TypeScript types are not exported properly #1793

Open
irshadahmad21 opened this issue Feb 10, 2024 · 0 comments
Open

TypeScript types are not exported properly #1793

irshadahmad21 opened this issue Feb 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@irshadahmad21
Copy link

Versions:

  • @inertiajs/core version:1.0.14
  • @inertiajs/react version: 1.0.14

Describe the problem:

When importing types in a project with NodeNext as module and moduleResolution in tsconfig.json, the types are not being resolved properly because.

Steps to reproduce:

// tsconfig.json
{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "strict": true
  }
}
// app.ts
import { VisitOptions } from '@inertiajs/core';

Error:

Screenshot 2024-02-10 at 9 29 18 PM
Module '"@inertiajs/core"' has no exported member 'VisitOptions'.

Similarly, there are other such errors for all the types when strict model is enabled in tsconfig.json

Screenshot 2024-02-10 at 9 27 48 PM
  • "Parameter 'title' implicitly has an 'any' type."
  • "Binding element 'el' implicitly has an 'any' type."
  • "Binding element 'App' implicitly has an 'any' type."
  • "Binding element 'props' implicitly has an 'any' type."
  • "Parameter 'name' implicitly has an 'any' type."

Reason

arethetypeswrong correctly points out the problems with the exported types

"@inertiajs/core""@inertiajs/core/server"
node10
node16 (from CJS) ⚠️ ESM (dynamic import only)
🚭 Unexpected module syntax
🥴 Internal resolution error (6)
⚠️ ESM (dynamic import only)
❗️ Incorrect default export
🚭 Unexpected module syntax
🥴 Internal resolution error
node16 (from ESM) 🥴 Internal resolution error (6)🥴 Internal resolution error
bundler
"@inertiajs/react""@inertiajs/react/server"
node10
node16 (from CJS) ⚠️ ESM (dynamic import only)
🚭 Unexpected module syntax
🥴 Internal resolution error (6)
⚠️ ESM (dynamic import only)
❗️ Incorrect default export
🚭 Unexpected module syntax
node16 (from ESM) 🥴 Internal resolution error (6)✅ (ESM)
bundler
@driesvints driesvints added the bug Something isn't working label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants