I have a Laravel project using vite InertiaJS and React
A unit test calling the Head module from @inertiajs/react
Was triggering this error
Cannot read properties of undefined (reading 'createProvider')
For this test I don’t really care about the Head module - but didn’t want to try and mock the whole of inertia-react
Read more ...For some reason I always seem to struggle getting code coverage reports picked up by SonarQube - the documentation isn’t bad but it seems to take me a while to find the right incantation .
I wanted both my PhpUnit tests and Javascript unit tests for my laravel project to generate coverage reports and import this to SonarQube.
Read more ...I am working on an application that needs to be able to login to a Laravel instance via API.
In my usual workflow all the session management and XSRF protection has been automagical but I needed to be able to build a test case - and all the docs seemed to assume it would “Just Work™”
Read more ...
InertiaJs does a great job of helping me build React apps on Laravel. The form help does a great job - especially with displaying validation messages.
But I couldn’t figure out how to change data and save the form in one action.
Read more ...This is one of those things I wont need again for a while and will forget.
When using nvm to get a new version of nodejs you can find you no longer have packages - including yarn
Read more ...The JavaScript ecosystem is a sea of choices and it seems to be all too easy to make an incompatible selection.
In my case I am using the Yarn package manager, the VSCode editor and TypeScript flavoured JS (I don’t think it really counts as a different language)
Every import statement was triggering an error in VScode
Cannot find module ’’ or its corresponding type declarations
Read more ...
I’m running Next.js apps in production using Kubernetes - and I’ve inherited some setup that I didn’t fully understand so I’ve been investigating what is going on with environment variables.
My inherited system used a build per environment and bakes in configuration at that point.
I dislike this because …
Read more ...Hugo - The world’s fastest framework for building websites is pretty awesome. It’s what I use to manage this site.

But much of the web development world has moved in the direction of JavaScript, npm, and Webpack.
So how can you run a Hugo website and manage the embedded JavaScript and CSS that are most commonly managed with npm and Webpack?
Read more ...What’s the difference between providing a rejection handler for a promise and catching errors ?
And why Does the React AJAX FAQ say
// Note: it's important to handle errors here
// instead of a catch() block so that we don't swallow
// exceptions from actual bugs in components.
Read more ...Setting up Sonarcloud integration with Gitlab was so easy as to be not worth documenting - just setup an account at each, import your projects on Sonarcloud and follow the step by step guide to start analysis.
But getting test coverage reports was harder.
Read more ...