dohomi / tamagui-kitchen-sink

Home of tamagui-extras, a component library which extends Tamagui with additional features..

Home Page:https://tamagui-extras.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to resolve module tamagui-extras/form

e-aleixandre opened this issue · comments

I'm trying to set up tamagui-extras into a expo + tamagui project. I installed the required dependencies and the IDE is properly importing the tamagui-extras components, but at build it's erroring out:

  node_modules
  2 | import { useRouter } from 'expo-router';
  3 | import { YStack } from 'tamagui';
> 4 | import { LmFormRhfProvider, LmInputRhf, LmSliderRhf, LmSubmitButtonRhf } from 'tamagui-extras/form';
    |                                                                                ^
  5 |
  6 | export default function Test() {
  7 |   const router = useRouter();

My package.json:

  "name": "xthing",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@shopify/flash-list": "1.4.0",
    "@tamagui/animations-react-native": "^1.12.1",
    "@tamagui/babel-plugin": "^1.12.1",
    "@tamagui/config": "^1.12.1",
    "@tamagui/font-inter": "^1.12.1",
    "@tamagui/theme-base": "^1.12.1",
    "@tamagui/themes": "^1.12.1",
    "babel-plugin-transform-inline-environment-variables": "^0.4.4",
    "burnt": "^0.10.0",
    "eslint-plugin-simple-import-sort": "^10.0.0",
    "expo": "~48.0.10",
    "expo-constants": "~14.2.1",
    "expo-font": "^11.1.1",
    "expo-linking": "~4.0.1",
    "expo-router": "^1.4.3",
    "expo-status-bar": "~1.4.4",
    "react": "18.2.0",
    "react-dom": "^18.2.0",
    "react-native": "0.71.6",
    "react-native-reanimated": "~2.14.4",
    "react-native-safe-area-context": "4.5.0",
    "react-native-screens": "~3.20.0",
    "react-native-web": "^0.19.1",
    "tamagui": "^1.12.1",
    "tamagui-extras": "^0.12.9"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.0.14",
    "@typescript-eslint/eslint-plugin": "^5.57.1",
    "@typescript-eslint/parser": "^5.57.1",
    "eslint": "^8.37.0",
    "eslint-config-universe": "^11.2.0",
    "eslint-plugin-unused-imports": "^2.0.0",
    "prettier": "^2.8.7",
    "typescript": "^4.9.4"
  },
  "private": true
}

Am I doing something wrong? I'd appreciate any help. If you need more information about my setup just ask.

Thanks.

this issue giving me the biggest headache of the year. Somehow expo is not able to code split tamagui-extras/form while NextJS and others can.. I look into it - but if anyone has experience with it please bring up ideas how to properly code split this lib into smaller pieces.

One idea: dump the the build step and keep the library TypeScript only. I could simply expose the src folder and apps would consume the TS files as it is.

Seems like it's working properly now. I know this might not be the place to ask for this but how can I change the style of the error helper text? Looks too big for my UI and a bit far down.

Edit: I've been checking the code. Perhaps it would be a good idea to let us pass helperProps to Lm components?

could you guys try out 0.12.11?

Seems like it's working properly now. I know this might not be the place to ask for this but how can I change the style of the error helper text? Looks too big for my UI and a bit far down.

Edit: I've been checking the code. Perhaps it would be a good idea to let us pass helperProps to Lm components?

can you open a separate issue, but I totally agree making helperProps customisable.

Can confirm 0.12.11 is working fine, I only get an error that doesn't seem to break anything. I'll open an issue for it and another one for the helperProps. Thanks for your work man.