Blog

Vite HMR WordPress DDEV

User import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import path from 'path' import { fileURLToPath } from 'url' const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) export default defineConfig({ base: '', // for WordPress theme builds plugins: [react()], build: { outDir: 'dist', assetsDir: 'assets', manifest: true, emptyOutDir: true, rollupOptions: { input: path.resolve(__dirname, […]

CORS error wrong endpoint

User Access to fetch at 'https://wprock.ddev.site/graphql' from origin 'https://wprock.ddev.site:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.Understand this error […]

Fetch Primary Menu React

User fetch primary menu in react using graphql wordpress we have already setup every thing just get me code Assistant Got it — you're saying the WordPress + GraphQL (WPGraphQL) part is already set up ✅, and you just want **the React code** to **fetch the Primary Menu** (normally `PRIMARY` or `PRIMARY_MENU` location) and display […]

LoaderContext import error

User Uncaught SyntaxError: The requested module '/src/contexts/LoaderContext.jsx' does not provide an export named 'LoaderContext' (at LoaderContextProvider.jsx:2:10) Assistant Alright, the error you are seeing: Uncaught SyntaxError: The requested module '/src/contexts/LoaderContext.jsx' does not provide an export named 'LoaderContext' means **inside your `LoaderContextProvider.jsx`**, you are trying to import `LoaderContext` from `LoaderContext.jsx`, **but `LoaderContext.jsx` doesn't actually export `LoaderContext`**. — […]

Loader issue after delete

User <script> import {ref,onMounted} from 'vue' import { useLoadingStore } from '@/stores/loading'; const loadingStore = useLoadingStore(); import api from '@/api' const projects = ref([]) const getProjects = async () => { try { loadingStore.setLoading(true) const response = await api.get('/projects') projects.value = response.data.data console.log(response.data.data) } catch (error) { console.log(error) } finally { loadingStore.setLoading(false) } } onMounted(() […]

SecurityError iframe access

User uncaught security error failed to read a property named document from window Assistant Got it — you're seeing this error: > **Uncaught SecurityError: Failed to read a property named 'document' from 'Window'** This usually happens **when you're trying to access `iframe.contentWindow.document`** **and** the iframe is **cross-origin** (i.e., the iframe's URL is from a different […]

Git force pull command

User Force pull Assistant To **force pull** in Git — meaning you want your local branch to exactly match the remote branch (even if it means losing local changes) — you can use: git fetch origin git reset –hard origin/your-branch-name Replace `your-branch-name` with the actual branch, e.g., `main` or `develop`. Or, in a single line […]

Set global email in Git

User set global email Assistant To **set a global email** in Git (so all repositories on your system use the same identity), run the following command in your terminal: git config –global user.email "your-email@example.com" You can also set the global name (if needed): git config –global user.name "Your Name" ### To verify the global configuration: […]

GitHub email for repo

User How to give client our gitub email so that they can add to me repo Assistant To give your **GitHub email** to the client so they can add you to a repository, follow these steps: ### ✅ 1. Share Your GitHub Username (Preferred Method) Rather than email, it's **standard** and **easier** to give them […]

GitHub Invite Correction

User Thanks for inviting github repo Could you please also invite me for Correct above sentence Assistant Sure! Here's the corrected version of your sentence: **"Thanks for inviting me to the GitHub repo. Could you please also invite me to the other one?"** Let me know if you want it to sound more formal or […]