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

HMR Doesn't Work For Layout File #403

Open
Barzi-Ahmed opened this issue Jan 10, 2025 · 1 comment
Open

HMR Doesn't Work For Layout File #403

Barzi-Ahmed opened this issue Jan 10, 2025 · 1 comment

Comments

@Barzi-Ahmed
Copy link

When editing _layout file, hmr doesn't get trigger, and i have to refresh page manually in browser.

This is the log in node:

2:44:00 PM [vite] (ssr) page reload app/layout.tsx
[vite] program reload
[vite] An error happened during full reload
[vite] cannot find entry point module 'virtual:one-entry'.
Error: [vite] cannot find entry point module 'virtual:one-entry'.
at fetchModule (file:///Users/user/Desktop/monorepo/node_modules/vite/dist/node/chunks/dep-BJP6rrE
.js:51477:13)
at async handleInvoke (file:///Users/user/Desktop/monorepo/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44166:22)
at async EventEmitter.listenerForInvokeHandler (file:///Users/user/Desktop/monorepo/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:44239:19)

Template: Minimal Tamagui

This is my package.json

{
	"name": "myapp",
	"version": "1.1.388",
	"private": true,
	"type": "module",
	"scripts": {
		"android": "one run:android",
		"build:web": "one build",
		"clean": "one clean",
		"dev": "one dev",
		"dev:clean": "one dev --clean",
		"ios": "one run:ios",
		"prebuild:native": "one prebuild",
		"serve": "one serve",
		"upgrade:tamagui": "$npm_execpath up '*tamagui*' '@tamagui/*'"
	},
	"dependencies": {
		"@tamagui/animations-css": "^1.121.7",
		"@tamagui/animations-moti": "^1.121.7",
		"@tamagui/colors": "^1.121.7",
		"@tamagui/image-next": "^1.121.7",
		"@tamagui/react-native-media-driver": "^1.121.7",
		"@tamagui/shorthands": "^1.121.7",
		"expo": "~52.0.24",
		"expo-font": "^13.0.2",
		"expo-modules-core": "2.1.2",
		"one": "1.1.393",
		"react": "^19.0.0",
		"react-native": "^0.76.6",
		"react-native-reanimated": "~3.16.6",
		"react-native-safe-area-context": "4.10.5",
		"react-native-screens": "4.4.0",
		"react-native-svg": "15.8.0",
		"react-native-web": "^0.19.13",
		"tamagui": "^1.121.7"
	},
	"devDependencies": {
		"@react-native-community/cli": "15.1.3",
		"@tamagui/vite-plugin": "^1.121.7",
		"@types/react": "^18.3.18",
		"vite": "^6.0.7"
	}
}

My vite.config.ts:

import type { UserConfig } from 'vite'
import { one } from 'one/vite'
import { tamaguiPlugin } from '@tamagui/vite-plugin'

export default {
	plugins: [
		one({
			react: {
				compiler: process.env.NODE_ENV === 'production',
				scan: true ,
			},

			web: {
				defaultRenderMode: 'ssr',
			},

			app: {
				key: 'fuga',
			},

			server: {
				platform:  'vercel'
			  },
		}),

		tamaguiPlugin({
			optimize: process.env.NODE_ENV === 'production',
			components: ['tamagui'],
			config: './src/tamagui/tamagui.config.ts',
			outputCSS: './src/tamagui/tamagui.css',
		}),
	],
} satisfies UserConfig

@justinmclaren
Copy link

I'm having this same issue. Did you find a solution?

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