expo / snack

Expo Snack lets you run Expo in the browser.
https://snack.expo.dev
MIT License
372 stars 111 forks source link

In Expo Snack, I have configured tsconfig, but still receiving, 'Cannot find module or its corresponding type declarations.(2307)' during json import #393

Open dineshgupta630 opened 1 year ago

dineshgupta630 commented 1 year ago

Summary

I am trying to learn React/React Native, and use Typescript, in React Native. This code works on my local but on Expo Snack,

Cannot find module './constants/theme/dark.json' or its corresponding type declarations.(2307)

Here's a link to my Expo -> https://snack.expo.dev/@dineshgupta630/quiet-crackers

image

My tsconfig.json

{  
  "extends": "expo/tsconfig.base",
  "compilerOptions": {
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "jsx": "react-native",
    "lib": ["dom", "esnext"],
    "moduleResolution": "node",
    "noEmit": true,
    "skipLibCheck": true
  }
}

What am I doing wrong or is this a bug?

What platform(s) does this occur on?

Android, iOS

SDK Version

47.0.0.1

Reproducible demo or steps to reproduce from a blank project

https://snack.expo.dev/@dineshgupta630/quiet-crackers