tchncs

Latest articles

This is the local timeline where you can see the latest articles from this instance. You can control the visibility of each of your blogs. New blogs are currently set to unlisted by default. You can change this in each blogs settings.

from 💭 where are you taking me?

⚡♦️ Fixing module preload paths within a Rails/Vite setup

Hello and happy new year! Today I'm writing about an asset related issue in a Rails application. Enjoy!

Several months ago, I migrated my Rails app from Webpack(er) to Vite, and I’ve been quite happy with the switch. Vite is blazingly fast, well-documented, and works seamlessly once properly configured.

This morning, while resolving CSP violations (all fixed now, by the way 🎉), I encountered the following error in the browser’s developer console:

Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of “text/html”. Strict MIME type checking is enforced for module scripts per HTML spec.

(This message comes from Chromium; it may appear slightly differently in other browsers.)

TL;DR

Stick around for the full story:

Nothing on my site appeared broken, but I wanted to resolve the issue anyway so I put on my debugging glasses.

My first findings in order:

  1. The problem doesn’t occur on every page load
  2. In the network tab, I noticed that certain requests were failing (highlighted in red)
  3. The trigger was the import of chart library modules
  4. The response content type of the failing requests was text/html, even though a JS file was requested
  5. The issue occurred only on specific servers (visible as i have a header showing the server name)

Given these observations, it became clear that the issue was tied to my asset host configuration. In short, I have one server that serves assets via a subdomain and also functions as a regular app server.

But why did the site still work despite failing imports?

A bit of research revealed that Vite preloads modules by default (see MDN on modulepreload). In a nutshell, JavaScript modules are preloaded for performance gains (they are not actually used until explicitly imported in your JS).

Since this behavior is controlled via an HTML attribute, I checked my page source and found several modulepreload links. These used relative paths, meaning they pointed to myapp.com/assets/foo.js instead of assets.myapp.com/assets/foo.js. As a result, requests hit the application servers, which responded with HTML instead of the JS file.

So why was Vite generating links with relative paths?

After some digging, I found a related issue. The fix is to set Rails.application.config.action_controller.asset_host (see the Vite Ruby docs).

Once configured, Vite generates absolute paths in the preload tags, resolving the issue.

However, I noticed URLs with double leading slashes (e.g., //assets.myapp.com/...). To fix this, I adjusted the Vite config:

import { defineConfig } from "vite"
import RubyPlugin from "vite-plugin-ruby"

export default defineConfig({
  base: "./",
  // other build configuration omitted
})

TL;DR

Adapt the following two things (first one is mandatory) to fix the issue:

# config/application.rb
# Can be set via environment variable
config.action_controller.asset_host = "https://yourassethost.yourapp.com" 
// vite.config.mts
export default defineConfig({
  base: "./",
  // other build configuration omitted
})

I needed to fix some specs and could deploy to staging for acceptance 😌

I hope this helps you if you run into a similar issue. Enjoy your day, and stay curious!

#rails #vite #viteruby #webdev

 
Read more...

from Der Emil

2026-01-06, etwa 21 Uhr

So fühle ich mich, wenn ich mich freimache von dem, was 15 Jahre lang mein Geländer war. So … So sonderbar unzufrieden und beruhigt.

Es ist Zufall, daß ich in einem von drei Ländern lebe, in dem der heutige Tag ein Feiertag ist. Aber im Gegensatz zu früher, da ich noch woanders wohnte, war am heutigen Tag bei mir nichts feierlich. Nichtmal das dritte festliche Abendessen habe ich mir gemacht – aber ich habe daran gedacht, wie das früher für mich, für uns, für die Familie war.

Traditionen enden. Alle. Irgendwann. Des bin ich sicher. Und auch ich kann Traditionen beenden, auslaufen lassen, nicht fortsetzen. Das weiß ich jetzt …

 
Read more...

from El blog de Aetherius Eldritch

En la estructura de las creencias originarias de México, la figura del Chaneque (del náhuatl chane, que significa “el que habita” o “dueño de la casa”) no se limita a la categoría de mito infantil, sino que constituye una entidad dentro de la gestión del equilibrio ecológico y espiritual de las culturas del Golfo y el Centro-Sur del país.

Los registros etnohistóricos vinculan a los chaneques con los Tlaloque, ayudantes del dios Tláloc. Según la cosmogonía náhuatl, estas entidades habitan en el Tlalocan, un nivel del inframundo caracterizado por la abundancia y la humedad. Su función principal es la protección de los recursos naturales, especialmente los cuerpos de agua, los animales silvestres y las selvas.

Se distinguen dos tipos de entidades en la tradición oral de regiones como los Tuxtlas en Veracruz:

  • Chaneques Blancos: Asociados a beneficios y protección, generalmente vinculados a lugares con agua limpia y vegetación densa.

  • Chaneques Negros: Entidades de carácter nocturno que residen en cuevas o barrancas, cuya interacción con los humanos se considera de alto riesgo.

Uno de los aspectos más documentados en la antropología y mitos sobre el chaneque es su capacidad para provocar el “espanto” o la pérdida del tonal (la fuerza vital o alma vinculada al día de nacimiento).

El proceso ocurre mediante un susto súbito en el que el chaneque “atrapa” el alma del individuo, provocando síntomas físicos específicos:

  • Decaimiento extremo y fatiga crónica. -Pérdida del apetito.
  • Palidez cutánea.

Para la recuperación del tonal, la medicina tradicional mexicana prescribe ritos de “limpia” y “llamado de sombra”, donde se utilizan elementos como el copal, la albahaca y rezos específicos para negociar la devolución de la energía vital con la entidad.

De acuerdo a las leyendas, los reportes de avistamientos son en las zonas rurales de Veracruz, Tabasco, Oaxaca y coinciden en una descripción morfológica recurrente:

  • Estatura: Aproximadamente de un metro a un metro veinte.

  • Fascies: Rostros que aparentan senectud o, por el contrario, facciones de infante, a menudo con pies invertidos (los talones hacia adelante), una característica mnemotécnica compartida con otras entidades del folclore global como la Curupira en Brasil.

  • Interacción: Su método de interacción habitual es la travesura o el despiste del viajero, alterando su percepción espacial para que se pierda en rutas conocidas.

En la práctica arqueológica y antropológica, se ha observado que las comunidades que habitan zonas de reserva mantienen protocolos de entrada a sus dominios. El uso de ofrendas consistentes en tabaco, aguardiente o alimentos sin sal actúa como un mecanismo de permiso para evitar la represalia de la entidad por la intrusión en espacios considerados sagrados o naturales.

 
Leer más...

from Cedaras Couch

Martin Walker: Bruno Chef de police

Seit längerer Zeit wollte ich schon in die Bruno Serie einsteigen, bin aber immer von abgekommen. Diesen Jahreswechsel ergab sich das Ausleihen des Hörbuches via Libby und weil es mir so gut gefiel, habe ich mir ein second-hand Exemplar des Buches gekauft.

Dies ist der erste Fall von Benoît Courrèges, genannt Bruno, dem Polizeichef des Dorfes Saint-Denis im Périgord. Der Autor führt gut in die Szenerie ein und gibt dem Lesenden die Zeit, die Charaktere kennenzulernen, bis dann der Mord geschieht.

Es ist ein brutaler Mord an einem alten Mann, was zuerst auf einen faschistischen Hintergrund durch Anhänger des Front National hinzuweisen scheint. Aber der Fall ist komplizierter und zum Teil durch Brunos Recherche werden einige Hintergründe klarer, die auf Ereignisse zur Zeit des Vichy Regimes in Saint-Denis hinweisen.

Mehr dazu zu verraten wäre ein Spoiler – aber mich hat es neugierig gemacht, ein paar Seiten im Netz zum Maquis und der Résistance im Périgord zu suchen.

Die für mich allerdings literarisch geschicktestes Szene ist diese:

” [Isabelle] stellte die Erdbeeren beiseite, rückte näher zu Bruno und schmiegte ihren Rücken an seine Brust. Bruno legte Isabelle seinen Arm um die Taille, worauf sie sich an ihn kuschelte und, als die Sonne schließlich unterging, seine Hand nahm und unter ihre Bluse führte.” (Ende Kapitel 22, S. 370)

Dies hat mich beeindruckt. Ich kann mich nicht erinnern, wo anders eine ähnlich gute Darstellung gefunden zu haben, wie ein weiblicher Charakter einem männlichen Charakter zeigt, dass körperliche Annäherung erwünscht ist. Es ist nicht plump, wortlos, und passt perfekt zur Zeichnung der Personen.

Mir hat das Buch sehr gut gefallen und ich denke ich werde die Serie weiterhin lesen.

 
Weiterlesen...

from provocatorio

L’esilio di George Clooney Signore e signori, posate i vostri avocado toast e prestate attenzione, perché stiamo assistendo a un dramma storico che fa apparire le Filippiche di Demostene come un battibecco su un gruppo WhatsApp di genitori.

George Clooney ha lasciato gli Stati Uniti.

Cloney in esilio

E no, non è la trama di Ocean’s 14: Fuga dal Fisco. È un vero e proprio esilio politico, una roba che non si vedeva dai tempi in cui i nobili fiorentini venivano cacciati dalla città e passavano il tempo a scrivere sonetti livorosi mangiando pane senza sale. Solo che George, al posto di scrivere l’Inferno, probabilmente sorseggia un Pinot Noir del 2015 in Provenza, guardando l’Atlantico con lo sguardo di chi ha appena visto il sequel non richiesto della democrazia americana.

​L’Ostracismo del Terzo Millennio ​Mentre il mondo si concentra sulle capsule di caffè, la sottotrama è degna di un thriller di spionaggio. Amal, una donna che probabilmente ha già riscritto il codice civile francese nel tempo di un volo transatlantico, è finita nel mirino della Casa Bianca. Per cosa? Per aver osato suggerire che il diritto internazionale si applichi a tutti, Netanyahu incluso.

​In risposta, l’amministrazione ha minacciato sanzioni: un ban che le impedirebbe di entrare negli USA. È il tocco di classe finale: se non puoi sconfiggere un avvocato per i diritti umani in tribunale, revocalegli il visto per il brunch a Manhattan. È la versione geopolitica del “non sei più invitata alla mia festa”.

​Il “Ciao Ciao” su Truth Social ​E come in ogni tragedia greca che si rispetti, non poteva mancare il coro. O meglio, il solista. Il “Re Sole” di Mar-a-Lago non ha perso tempo e ha esultato su Truth Social con la grazia di un lottatore di wrestling che ha appena vinto per abbandono dell’avversario.

​”Buone notizie! George e Amal, due dei peggiori analisti politici di sempre, sono diventati cittadini francesi. La Francia ha un problema orrendo di criminalità e immigrazione… Parigi è la benvenuta a tenerseli!”

​Leggere i post di Trump è come leggere un’epigrafe di Marziale, ma scritta con il caps lock bloccato e un eccesso di diet coke. Definire George un “attore mediocre” è il suo modo di dire “mi manchi, ma non so come scrivertelo senza sembrare un debole”.

​Il Truman Show Provenzale ​George ha risposto col suo solito stile, tra il sornione e il distaccato: “Sono d’accordo col Presidente, dobbiamo rendere l’America di nuovo grande. Cominceremo a novembre”. Una stoccata che brucia più di un caffè bruciato, appunto.

​Analizziamo i fatti con piglio storiografico:

​L’Esilio: George raccoglie le sue Nespresso e si rifugia nel sud della Francia. ​La Motivazione: Ufficialmente “privacy per i figli”. Ufficiosamente, evitare che Amal debba discutere di mandati d’arresto internazionali attraverso un vetro blindato alla frontiera. ​Il Risultato: Gli USA perdono il loro volto più elegante, e la Francia guadagna un cittadino che parla un francese terribile ma porta un’aura di charme che abbasserà l’età media del cinismo europeo. ​George non è fuggito, si è “ritirato strategicamente”. È il nostro moderno Cincinnato, che invece di tornare all’aratro, torna al torchio per l’uva. In fondo, ci insegna la lezione definitiva: se il tuo Paese ti mette all’indice, assicurati che il Paese dove scappi abbia almeno tre stelle Michelin ogni dieci abitanti.

 
Continua...

from Michael Gisiger

asdf

Den aufmerksamen Besucherinnen und Besuchern ist es sicherlich schon aufgefallen: Hier tut sich etwas! Tatsächlich bin ich mit einem Teil meiner Beiträge umgezogen. Unter „EpicMind – Weisheiten für das digitale Leben“ blogge ich neu auch weiterhin über Lernen, Produktivität, Selbstmanagement und Technologie. Der neue Blog wurde ebenfalls mit WriteFreely erstellt und ist somit auch im #Fediverse föderiert. Allerdings habe ich nun einen Account bei den Machern von WriteFreely, write.as, erstellt. Neben einigen weiteren Features wie E-Mail-Abo und -Newsletter ermöglicht mir dies, unter einer eigenen Domain zu bloggen. Aktualisiert also eure Lesezeichen!

EpicMind abonnieren

Ihr könnt meinen neuen Blog wie folgt abonnieren:

Ich freue mich, euch auch am neuen Ort wiederzusehen.

Und wie geht es hier weiter?

Ich werde diesen Blog nicht schliessen, sondern ihn zum dritten Mal neu ausrichten. Wahrscheinlich werde ich hier kurze Gedanken, Links u. a. posten, die für #Mastodon zu lang sind. Wir werden sehen. Aber es geht auch hier weiter.

Ich wünsche euch allen ein gutes und erfolgreiches 2026!


Bildquelle Foto von Marija Zaric auf Unsplash.

Topic #Interna

 
Weiterlesen...

from Nate's Blog

Holos announced they're working on adding custom domain support to their server. It's a really cool development, and I figured I'd share it here real quick.

If you're unfamiliar with Holos, it's an Activity Pub server that aims to be more relay like (somewhere between AT/Nostr and a standard Activity Pub account). The server acts as a relay, keeping a public copy of your posts and profile data online, but it delegates most operations to your client.

When I wrote about it a month ago it sounded like it was a possible consideration, but having it confirmed as something that's actually going to be the case is really cool to see. At the cost of being a bit more technical, the idea of owning your identity on Activity Pub is really cool (you 'own' your own domain, plus are able to migrate even if the server is down since your client can make outgoing connections).

Anyway, figured it was worth a share, I'm looking forward to seeing Holos continue to be developed.

 
Read more...

from Der Emil

Sollte viel öfter möglich sein. Und auch viel freier!

Dann würd ich ins Jahr 1989 wechseln wollen. Oder gleich ins Jahr 2033. Dann hätte ich die Jahre 2020, 2021, 2022, 2023 nie mitgemacht. Ich hätte einfach in ein anderes Jahr gewechselt.

Ihr meint, es sein verwirrend, wenn alle plötzlich das Jahr, in dem sie leben, anders bezeichnen? Es wäre doch aber möglich, einen Konsens zu finden, nach dem das allgemein bezeichnet wird: Das aktuelle Jahr. Es kommt ja auch niemand auf die Idee, daß alle Betriebe ihr Geschäftsjahr zur gleichen Zeit beginnen und beenden müssen …

Eine eigne Zeitrechnung, eine, die für mich paßt, finden und leben. Statt Wochen zu sieben Tagen eben Quintolen zu fünf planen. Und statt der zwölf Monate einfach zehn Jahrstel zu je sechs Quintolen – und die nicht darin enthaltenen Tage als Freitage an einem Stück dann nehmen, wenn es paßt?

Aber ach ja, das ist ja alles nicht möglich, da kommt die Menschheit ja komplett durcheinander. Wo kämen wir denn hin, wenn der wichtigste Maßstab allen Handelns das Wohlbefinden aller Menschen sein sollte?

 
Read more...

from Jadoo

sha512

خوب گاهی پیش میاد که شما یک فایل رو از جایی دانلود میکنید یا کسی براتون می‌فرسته ولی از کجا بدونیم دقیقا همون فایلی که اراسل شد یا توی سرور بود رو دانلود کردیم؟ اصلا ایا فایل کامل و بدون مشکل دانلود شد؟

راه حل اینه که از فرستنده بخواهیم برامون کد SHA512 یا هر نوع هش دیگه‌ای که می‌تونه رو برامون بفرسته که بتونیم بعدا چک کنیم. حالا این کد چطور ساخته میشه؟

توی کامپیوتر مبدا ویندوز/لینوکس/مک میتونیم از دستورات زیر برای بدست آوردن این کد استفاده کنیم. البته وب‌سایت‌هایی هم هستند که بصورت انلاین براتون ایجاد می‌کنند هرچند اگه فایلتون خیلی بزرگ باشه استفاده از اون‌ها منطقی نیست.

# open terminal and use bellow command

# Windows
certutil -hashfile <fileName> sha512

# Linux

sha512sum <filename>

# MacOS
shasum -a512 <filename>

همه‌ای این دستورات به شما یک کد ثابت می‌دهند که می‌تونید به طرف دیگه که فایل رو دانلود کرده بدهید تا توی کامپیوتر خودش چک کنه. اگه کد‌ها یکسان بودند یعنی فایل دقیقا همون چیزی است که توی کامپیوتر شما بوده در غیر اینصورت یعنی درست دانلود نشده و یا حتی این وسط تغییری روی فایل ایجاد شده.

نکته مهم اینکه کوچکترین تغییری اگه این وسط اتفاق بیافته تفاوت کد خروجی خیلی خیلی زیاد خواهد بود. یک نکته مهم دیگه اینکه اسم فایل یا اینکه در چه مسیری است اصلا تاثیری توی این کد نخواهد داشت. بلکه محتویات اون است که اهمیت داره.

 
Read more...

from The Dream Diary

In this dream I was in a white building and everyone was getting shot and I was running for my life LITERALLY. Then I was behind one of the pillars and a guy came and said there is no purpose of living and I ran. Then he threw a grenade at me and it landed beside me and I ran away, and I think one couple who was there walking past me with the baby was exploded.

That area looked like a park and everyone was there happy; when he threw a grenade or had a gun in his hand, no one cared about it and the whole park was green with no trees. After I ran like CRAZY I got very, very tired and a group of men grouped me in a circle and told me there is nowhere to go. Then I threw something away and everyone was distracted by it. By the way, there were trees and no one was there except those guys.

So when they were distracted I ran and I was feeling that tiredness, so much that I could not run anymore, but I dragged myself and I got to a gate which was chained from the top. I pushed it and it opened a little. From that opening I was out of that area and crossed the road. While crossing, they were behind me and then I woke up. I also saw a car coming towards me. Also, that area where I was running had the same tiles and same rocky surface which was the area behind the park of my old house in real life. Also, that gate was also the same old and rusty one. * Got it more than 1 time – No

#dream #nightmare #escape #research #oldhouse

 
Read more...

from The Dream Diary

In this dream I was in my house, and what I do is whenever I drink water, I always put the empty glass on the refrigerator so I can use it again.

So in the dream, I was going to drink a glass of water, and as soon as I took that empty glass, I saw that there was a black worm roaming inside it, with a red aura underneath.

In another dream which came to me after this one, I was making tea as usual for me and my parents. When I passed the cup of tea to my mom, I saw this black worm coming out of the tea and swimming to the area near my mother’s side, then swimming back to me and getting into my skin.

That worm was not long, but thick in the middle, with an upward curve in the center. It had a shape like this ()—like a kite but with smooth edges. It also had small legs like a frog and no eyes.

* Got it more than 1 time – Yes

#weird #afterwritingblog #sleep

 
Read more...

from The Dream Diary

In this dream I was in a place, and a black van was in front of me. From that black van, two cows slid on a grass slider in front of me.

Then I said to the guy, whom I did not see, “What about the male cows? They would burn their feet.”

Out of nowhere, a black cow appeared, and the background shifted to a green area. Nothing was there, and the feet of that black male cow were burning.

* Got it more than 1 time – No

#weird #afterwritingblog #nap

 
Read more...