ivopr / tamagui-expo

An Expo template with Tamagui
270 stars 22 forks source link

Fresh install throws error for tamagui/linear-gradient #38

Closed danilopolani closed 1 year ago

danilopolani commented 1 year ago

First of all, thank you for the template! I hope to see soon an update for Expo SDK 49 (that is in beta right now) πŸ˜„ Anyway, I created a repo following the instructions, then after having installed the yarn dependencies, I ran yarn start.
When I opened the app with Expo Go, however, this error occurred.

Note that I'm working on Windows 11 without WSL.

Android Bundling failed 714ms
error: Error: While resolving module `tamagui/linear-gradient`, the Haste package `tamagui` was found. However the module `linear-gradient` could not be found within the package. Indeed, none of these files exist:      

  * `D:\tamagui\linear-gradient(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
  * `D:\tamagui\linear-gradient\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)`
    at resolveHasteName (D:\tamagui\node_modules\metro-resolver\src\resolve.js:173:9)
    at Object.resolve (D:\tamagui\node_modules\metro-resolver\src\resolve.js:63:20)
    at ModuleResolver.resolveDependency (D:\tamagui\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:111:31)
    at DependencyGraph.resolveDependency (D:\tamagui\node_modules\metro\src\node-haste\DependencyGraph.js:260:43)
    at Object.resolve (D:\tamagui\node_modules\metro\src\lib\transformHelpers.js:177:21)
    at Graph._resolveDependencies (D:\tamagui\node_modules\metro\src\DeltaBundler\Graph.js:432:35)
    at Graph._processModule (D:\tamagui\node_modules\metro\src\DeltaBundler\Graph.js:218:38)
    at async Graph._addDependency (D:\tamagui\node_modules\metro\src\DeltaBundler\Graph.js:314:20)
    at async Promise.all (index 7)
    at async Graph._processModule (D:\tamagui\node_modules\metro\src\DeltaBundler\Graph.js:263:5)
ivopr commented 1 year ago

So, some time Ago (when I First created this template) tamagui wasn't 100% compatible with Windows, at that time I already used WSL for everything related to coding on my Windows Machine, then I migrated to Linux, and (for) Now, It is my daily driver. In a month or so I'm expecting to make windows my daily driver again, so I'll be able to effectively debug this then. Until then, I'll do some probing about tamagui, update myself about what is going on with it and hopefully make this template even better. I'm Sorry that I'm unable to give you an immediate help, I'll leave this open so It is visible. I'll probably try something tomorrow If I find any leading on this.

danilopolani commented 1 year ago

Don't worry, you already did a great job! I've tried on mac and everything works just fine, I'm gonna try with the WSL proxy, if that is gonna solve it we can call it a day

ivopr commented 1 year ago

@danilopolani did things work out? I'm at the moment setting my things up on windows again (on wsl) so I can help or at least try to help now

danilopolani commented 1 year ago

@danilopolani did things work out? I'm at the moment setting my things up on windows again (on wsl) so I can help or at least try to help now

I was able to solve the linear-gradient issue by importing @tamagui/linear-gradient instead of tamagui/linear-gradient, then more errors appeared and for some reason the proxy for ip/port of Expo from WSL to Windows did not work for me.
At the end I've switched over React Native Paper, although probably I will just not use any UI library since that library too has a few issues and apart from dialogs, modals etc. the other components are easy to stylize πŸ˜…

ivopr commented 1 year ago

Good to see that your found your way to go. Windows is kinda tricky specially as most people involved in tamagui as far as I know use Mac/Linux. I'll check the bypass thing now that I'm on windows again. I'll also be closing this for now. If anything, feel free to reopen.