-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Describe the bug
I'm working on a Universal Renderer project in which I have a module with:
const [focusedElm, setFocusedElm] = createSignal(null);
export const useFocusManager = createSingletonRoot(() => {
const keypressEvent = useKeyDownEvent();
let focusPath = [];
createEffect(on(focusedElm, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {
The focusedElm is meant to be a global signal. Inside a Browse page I have:
const Browse = () => {
const [focusedElm, setFocusedElm] = useFocusManager();
let focusRingRef;
createEffect(on(focusedElm, (elm) => {
console.log('Focused Ring Change', elm);
if (focusRingRef?.lng && elm?.lng) {
// No Absolute X Y yet from renderer
focusRingRef.lng.parent = elm.lng;
}
}, { defer: true}))
When running in dev mode, both effects are being called as expected. When I build for production only the effect in the focusManager module is being called. The one in the Browse page never gets called. I've tried not using on and defer and various mutations to try to get it working but I'm stumped by the difference in build between dev and prod that would cause this.
Your Example Website or App
none
Steps to Reproduce the Bug or Issue
dev vs prod
Expected behavior
I expect createEffect to be called in both dev and prod
Screenshots or Videos
No response
Platform
- OS: mac
- Browser: chrome
vite/4.3.9 darwin-arm64 node-v16.15.1
Additional context
"scripts": {
"start": "vite --open --host",
"build": "vite build --sourcemap=true",
"preview": "vite preview --open --port 8080",
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';
export default defineConfig({
plugins: [solidPlugin({
solid: {
moduleName: "@lightningjs/solid",
generate: 'universal'
}
})],
server: {
hmr: false,
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels