Windows 10 vs Manjaro Linux serving Javascript
So this is brain breaker. I have a Django web application that makes use of TailwindCss. On a certain page I have made use of a TailwindCss plugin named TW-Elements. This plugin allows me to easily implement tab functionality.
However, when I run the code on my Manjaro Linux operating system it works like a charm. When running the same code on a Windows operating system (not my choice) I get the following error:
The workaround is running everything from a Docker container and not be dependent on Windows. Although this works my brain needs to know WHY this problem occurs in the first place. It is probably something super simple and annoying from the Javascript world. Please help me uncovering this mystery.
Here are some extra details
I used pnpm to install the package.json node modules in a folder called jstoolchain. This folder also holds the package.json.
Below is the html template I use the following code to retrieve the Javascript module:
<script
type="text/javascript"
src="/jstoolchain/node_modules/tw-elements/dist/js/tw-elements.umd.min.js">
</script>
Below is the package.json file. Please note I use a different Django tree structure. APP_FOLDER holds all the apps and theme all the templates and static resources.
{
"name": "jstoolchain",
"version": "1.0.0",
"description": "",
"main": "../../static/js/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"tailwind-watch": "tailwindcss -i ../APP_FOLDER/theme/static/css/input.css -o ../static/css/output.css --watch",
"tailwind-build": "tailwindcss -i ../APP_FOLDER/theme/static/css/input.css -o ../static/css/output.css --minify"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"tailwindcss": "^3.3.3"
},
"dependencies": {
"idb": "^7.1.1",
"tw-elements": "^1.0.0"
}
}
Below is the tailwind.config.js file also located in jstoolchain:
// tailwind.config.js
/** @type {import('tailwindcss').Config} */
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
content: [
"../dcc_facilitator/theme/templates/**/*.{html,js}",
"../dcc_facilitator/**/templates/**/*.{html,js}",
"venv/Lib/site-packages/crispy_tailwind/**/*.html",
"venv/Lib/site-packages/crispy_tailwind/**/*.py",
"venv/Lib/site-packages/crispy_tailwind/**/*.js",
"./jstoolchain/node_modules/tw-elements/dist/js/**/*.js",
],
plugins: [
require("tw-elements/dist/plugin"),
require('@tailwindcss/forms'),
],
darkMode: "class",
theme: {
extend: {
fontFamily: {
sans: ['Open Sans', /*...*/ defaultTheme.fontFamily.sans],
},
},
},
}
I tried different node modules installations with different versions of node js and pnpm operating systems (Windows and Linux).
WINDOWS 10:
- node version: v20.11.0 | v21.6.1 (tried both)
- pnpm: 8.14.3
MANJARO LINUX:
- node version: v21.5.0
- pnpm: 8.13.1
