#Tail not working
1 messages ยท Page 1 of 1 (latest)
I can't see logs to find out if adding axios to an api call is the problem, I updates to 2.2 but when axios is in the code all I get is a white screen.
Code used:
const handleScanValue = async (code: string) => {
if (isProcessing.value) {
console.log('Already processing a scan, ignoring duplicate')
return
}
isProcessing.value = true
scannedCode.value = code
scanStatus.value = 'Verifying QR code...'
emit('barcode-scanned', code)
try {
const { data } = await axios.post(baseUrl + '/api/check', { code })
scanStatus.value = 'Login successful! Redirecting...'
if (data.token) {
await secureStorage.set('accessToken', data.token);
}
// Redirect or reload
window.location.href = route('dispatch.index')
} catch (error: any) {
console.error('Login error:', error)
const errorMsg = error.response?.data?.message || 'Login failed. Please scan again.'
scanStatus.value = errorMsg
scannedCode.value = ''
setTimeout(() => {
scanStatus.value = null
forceFocus()
}, 3000)
} finally {
setTimeout(() => {
isProcessing.value = false
}, 1000)
}
}
Also hot reloading doesn't appear to be working, if I run npm run build -- --mode=android && a native:run android works fine runs in the emulator with no issues. but if I add --watch to the end it runs with a blank screen.
Not sure if it's me or something else, but this quite painful having to rebuild every time to see changes. @faint spoke @brittle copper Any suggestions or ideas please chaps ๐
FYI, Axios seems to be working fine now just the hot reloading.
Still tail log don't show get tail: app_storage/persisted_data/storage/logs/laravel.log: No such file or directory
Vite config is:
import { wayfinder } from '@laravel/vite-plugin-wayfinder';
import tailwindcss from '@tailwindcss/vite';
import vue from '@vitejs/plugin-vue';
import laravel from 'laravel-vite-plugin';
import { defineConfig } from 'vite';
import { nativephpMobile, nativephpHotFile } from './vendor/nativephp/mobile/resources/js/vite-plugin.js';
export default defineConfig({
plugins: [
nativephpMobile(),
laravel({
input: ['resources/js/app.ts'],
ssr: 'resources/js/ssr.ts',
refresh: true,
hotFile: nativephpHotFile(),
}),
tailwindcss(),
nativephpMobile(),
wayfinder({
formVariants: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
],
});
composer has "nativephp/mobile": "^2.3",
Any advice would be appreciated
Seems other are reporting similar issues with hot reloading!
Lee. I also had a problem with a white screen and with query params being dropped from my axios requests. I switched to fetch and things started working. This was on iOS simulator for me. I have not tried Android yet.