Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import process from 'node:process'
import { currentLocales } from './config/i18n'
import { isCI, isTest, provider } from 'std-env'
import { isCI, isDevelopment, isWindows, isTest, provider } from 'std-env'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the nuxt.config.ts file
find . -name "nuxt.config.ts" -type f

Repository: npmx-dev/npmx.dev

Length of output: 99


🏁 Script executed:

# Once we locate it, let's examine lines around 3 and 18
cat -n nuxt.config.ts | head -30

Repository: npmx-dev/npmx.dev

Length of output: 931


🌐 Web query:

nuxt-security module Windows compatibility limitations requirements

💡 Result:

Windows compatibility (nuxt-security / nuxt-security)

  • No Windows-specific limitation is documented: the module is JavaScript/TypeScript and is expected to work on Windows, macOS, and Linux anywhere Nuxt runs. [1]
  • Practical “Windows compatibility” therefore mostly means: your Node + Nuxt versions must be supported, and your target runtime (Node serverless/edge/worker/static) must support the underlying Nuxt/Nitro features you’re using. [1]

Requirements

  • Nuxt: Nuxt 3.x or newer (incl. Nuxt 4.x). [1]
  • Node.js: Node 18+ (Nuxt 3’s baseline; nuxt-security explicitly restored/targets Node 18 compatibility). [2]

Notable limitations / constraints (not Windows-specific)

  • Strict CSP nuances: strict-dynamic is script-src only, and it authorizes scripts, not styles (dynamic styles can still be blocked depending on your setup). [3]
  • Devtools + strict CSP: there have been compatibility edge-cases between Nuxt DevTools script injection and strict CSP nonce injection (fixed/improved over time, but it’s a known area). [4]
  • Lightweight runtimes (workers/edge): the project has explicitly optimized to reduce CPU/memory (e.g., removing cheerio) to behave better in lightweight environments—meaning runtime choice can matter more than OS choice. [5]

Sources: [1] [2] [3] [4] [5]


Avoid disabling nuxt-security for every Windows environment.

Line 18 currently skips the module whenever isWindows is true, including production runs, which silently removes security hardening. Web verification confirms no documented Windows-specific limitations exist for nuxt-security—the module is JavaScript/TypeScript and works across all operating systems where Nuxt runs.

Suggested patch
-    ...(isDevelopment || isWindows ? [] : ['nuxt-security']),
+    ...(isDevelopment && isWindows ? [] : ['nuxt-security']),


export default defineNuxtConfig({
modules: [
Expand All @@ -15,6 +15,7 @@ export default defineNuxtConfig({
'@vueuse/nuxt',
'@nuxtjs/i18n',
'@nuxtjs/color-mode',
...(isDevelopment || isWindows ? [] : ['nuxt-security']),
],

$test: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"module-replacements": "2.11.0",
"nuxt": "4.3.1",
"nuxt-og-image": "5.1.13",
"nuxt-security": "2.5.1",
"ofetch": "1.5.1",
"ohash": "2.0.11",
"perfect-debounce": "2.1.0",
Expand Down
74 changes: 71 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading