Closed gloredo closed 1 year ago
Thanks for the good reproduction. I wonder if some Next.js-related code is being imported by your app directly at the wrong time. Checking now.
So, the issue is, as far as the repro goes, it's using the tamagui starter rather than the solito one...so it has a lot of tamagui-related code that may be causing this, rather than solito's. Can you clarify which line getting removed fixes it? is it the homepage that's broken because of a solito import? Thanks!
Ahhh, I see the issue! You imported import { useLink } from 'solito/link'
. However, as the docs state, to use this with app
router, you need to import { useLink } from 'solito/navigation'
. That should fix it!
Thanks for the reply @nandorojo
I had try this but I get Module '"solito/navigation"' has no exported member 'useLink'
.
please upgrade
I started this issue in the tamagui repo, but decided to open it here after finding that removing the calls to Solito solved the problem.
next-expo-solito-monorepo
:cd packages/app && yarn add solito@canary
to installSolito v4
cd packages/app && yarn add next@latest && yarn add -D eslint-config-next@latest
to updatenext.js
apps/next/pages
apps/next/next.config.js
setexperimental.appDir: true
(optional: This option is no longer needed as of Next.js 13.4. The App Router is now stable)cd packages/ui && yarn add @tamagui/config@latest
to fixCannot find module '@tamagui/config' or its corresponding type declarations.
inapps/next/app/TamaguiProvider.tsx
apps/next/app/TamaguiProvider.tsx
changeTamagui.getCSS
toTamagui.getNewCSS
packages/app/features/user/detail-screen.tsx
changeimport { createParam } from 'solito'
toimport { useParams } from 'solito/navigation'
Throws error when
cd apps/next && yarn build
:Reproduction
https://codesandbox.io/p/sandbox/create-tamagui-appdir-build-error-65jk6z
System Info