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
737 stars 56 forks source link

RollupError: Could not resolve `../../../utils` #438

Closed schaubes closed 2 months ago

schaubes commented 2 months ago

After todays update to v1.4.0 using pnpm I get following error:

ERROR  RollupError: Could not resolve "../../../utils" from "node_modules/.pnpm/nuxt-security@1.4.0_rollup@4.16.4/node_modules/nuxt-security/dist/runtime/nitro/plugins/00-routeRules.mjs"

Version

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

Reproduction Link

Can post if necessary

Steps to reproduce

Initializing a new nuxt app with pnpm and adding nuxt-security

npx nuxi@latest init test-app
cd test-app/

# add nuxt-security
npx nuxi module add security

# run dev server with pnpm
pnpm run dev

What is Expected?

pnpm run dev should start normally

What is actually happening?

ERROR  RollupError: Could not resolve "../../../utils" from "node_modules/.pnpm/nuxt-security@1.4.0_rollup@4.16.4/node_modules/nuxt-security/dist/runtime/nitro/plugins/00-routeRules.mjs"
MarijnFK commented 2 months ago

Jup, same here

Baroshem commented 2 months ago

Hey, thanks for reporting this issue. We are on it!

Baroshem commented 2 months ago

This is really strange. At first I thought that the issue is related to wrong dist generation (I copied the dist to the node modules of the project) and project started working.

But it can be something else, still investigating.

Baroshem commented 2 months ago

It should work now with 1.4.2. @MarijnFK @schaubes could you verify?

@vejja I needed to add a copy of defuReplaceArray to the utils of the runtime. The import works locally but fails when released in a published dist package.

vejja commented 2 months ago

It should work now with 1.4.2. @MarijnFK @schaubes could you verify?

@vejja I needed to add a copy of defuReplaceArray to the utils of the runtime. The import works locally but fails when released in a published dist package.

Ah yes makes sense now

garyellow commented 2 months ago

It should work now with 1.4.2. @MarijnFK @schaubes could you verify?

@vejja I needed to add a copy of defuReplaceArray to the utils of the runtime. The import works locally but fails when released in a published dist package.

It works with v1.4.2 thx~~

MarijnFK commented 2 months ago

Quickly fixed, thanks!