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

bug: Type checking throws internal expo router type errors #726

Closed
hichemfantar opened this issue Nov 4, 2023 · 4 comments
Closed

bug: Type checking throws internal expo router type errors #726

hichemfantar opened this issue Nov 4, 2023 · 4 comments

Comments

@hichemfantar
Copy link
Contributor

hichemfantar commented Nov 4, 2023

Provide environment information

npx envinfo --system --binaries

  System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i5-10500H CPU @ 2.50GHz
    Memory: 10.50 GB / 15.40 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
    Yarn: 3.6.0 - ~/.nvm/versions/node/v18.18.2/bin/yarn
    npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm

npx expo-env-info

  expo-env-info 1.0.5 environment info:
    System:
      OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
      Shell: 5.0.17 - /bin/bash
    Binaries:
      Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
      Yarn: 3.6.0 - ~/.nvm/versions/node/v18.18.2/bin/yarn
      npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
    npmPackages:
      expo: ^49.0.16 => 49.0.16 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.72.6 => 0.72.6 
    npmGlobalPackages:
      eas-cli: 5.4.0
    Expo Workflow: managed

Describe the bug

Running tsc --noEmit throws internal expo router errors alongside project type errors.

Entry file is defined package.json "main": "index.ts"
Entry file content:

// setup sentry then import the router
import "./sentry-setup";
// This is the entry point for the Expo app.
// It is responsible for setting up the router, root component and loading pages.
import "expo-router/entry";

Currently using a t3-turbo setup with yarn.

Found 61 errors in 16 files.

Errors  Files
     1  app/(authed)/chat.tsx:996
     1  app/(authed)/cvWizard/educationStep.tsx:70
     3  app/(authed)/cvWizard/experienceStep.tsx:68
     1  app/(authed)/cvWizard/languageStep.tsx:73
     1  app/(authed)/cvWizard/skillStep.tsx:62
     2  node_modules/expo-router/src/LocationProvider.tsx:24
     4  node_modules/expo-router/src/Route.tsx:99
     1  node_modules/expo-router/src/exports.ts:26
     2  node_modules/expo-router/src/fork/findFocusedRoute.tsx:8
    19  node_modules/expo-router/src/fork/getPathFromState.ts:50
    12  node_modules/expo-router/src/fork/getStateFromPath.ts:240
     5  node_modules/expo-router/src/getRoutes.ts:62
     2  node_modules/expo-router/src/global-state/routing.ts:166
     4  src/components/Switch/index.tsx:34
     1  src/components/myJobs/Card/index.tsx:333
     2  src/constants/jobs.ts:22

tsconfig.json

{
	"extends": "expo/tsconfig.base",
	"compilerOptions": {
		"strict": true,
		"skipLibCheck": true,
		"baseUrl": ".",
		"types": ["node", "nativewind/types"],
		"useUnknownInCatchVariables": false,
		"paths": {
			"@fonts": ["./assets/fonts"],
			"@images": ["./assets/images"],
			"@apis": ["./src/utils/api.tsx"],
			"@assets": ["./src/assets/index.ts"],
			"@components": ["./src/components/index.ts"],
			"@configs": ["./src/configs/index.ts"],
			"@constants": ["./src/constants/index.ts"],
			"@hooks": ["./src/hooks/index.ts"],
			"@layouts": ["./src/layouts/index.ts"],
			"@screens": ["./src/screens/index.ts"],
			"@services": ["./src/services/index.ts"],
			"@utils": ["./src/utils/index.ts"],
			"@skeleton": ["./src/skeleton/index.ts"],
			"@navigation": ["./src/navigation/index.ts"],
			"@types": ["./src/types/index.ts"],
			"@store": ["./src/store/index.tsx"],
			"@translation": ["./src/translation/index.ts"]
		},
		"target": "es2017",
		"lib": ["dom", "dom.iterable", "esnext"],
		"allowJs": true,
		"checkJs": true,
		"forceConsistentCasingInFileNames": true,
		"noEmit": true,
		"esModuleInterop": true,
		"module": "esnext",
		"moduleResolution": "node",
		"resolveJsonModule": true,
		"isolatedModules": true,
		"jsx": "react-native",
		"incremental": true,
		"noUncheckedIndexedAccess": true,
		"noImplicitAny": false,
		"strictNullChecks": true
	},
	"include": [
		"app",
		"expo-plugins",
		"src",
		"*.ts",
		"*.tsx",
		"*.js",
		"*.jsx",
		".expo/types/**/*.ts",
		"expo-env.d.ts"
	]
}

Link to reproduction

Couldn't reproduce the issue for now with a fresh expo app (will test with a new t3 project)

To reproduce

Couldn't reproduce the issue for now with a fresh expo app (will test with a new t3 project)

Additional information

No response

@hichemfantar
Copy link
Contributor Author

Could be an expo router issue
expo/expo#25213 (comment)

@juliusmarminge
Copy link
Member

exclude node_modules:

"exclude": ["node_modules"]

@hichemfantar
Copy link
Contributor Author

@juliusmarminge It is excluded, It's already excluded in the expo base config and also tried manually

@juliusmarminge
Copy link
Member

Hopefully it's resolved now with Expo 50 introduced in #795. Reopen if you still havre issues

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

2 participants