Baroshem / nuxt-security

🛡 Automatically configure your app to follow OWASP security patterns and principles by using HTTP Headers and Middleware
https://nuxt-security.vercel.app/
MIT License
808 stars 56 forks source link

routeRules import paths error in v1.4.0 #439

Closed maxdzin closed 5 months ago

maxdzin commented 5 months ago

Version

nuxt-security: v1.4.0 nuxt: v3.11.2

Reproduction Link

https://stackblitz.com/edit/github-ymby1y

Steps to reproduce

Just see the console output

What is Expected?

Nuxt app to be launched without errors.

What is actually happening?

[nitro 10:34:45 AM]  ERROR  RollupError: Could not resolve "../../../utils" from "node_modules/nuxt-security/dist/runtime/nitro/plugins/00-routeRules.mjs"

It seems need to be ../../utils instead. And the paths in files inside dist/runtime/nitro/plugins/... need to be checked as well.

garyellow commented 5 months ago

same issue on Vercel nuxt-security: v1.4.1

image

maxdzin commented 5 months ago

Oops! It seems already reported in another issue #438 while I prepared this one 😄

Baroshem commented 5 months ago

Can you guys try 1.4.2? I tried it and it seems to be working :)

maxdzin commented 5 months ago

@Baroshem it works. I removed the module from deps and installed it via command: npx nuxi@latest module add security now it is added as dependency (previously it was dev dependency). I already asked that in the discussion: is there a reason to move that to deps instead of dev deps?

Baroshem commented 5 months ago

Closing the issue then. @maxdzin lets continue this discussion in the discussion created by you :)