Skip to content

"This module cannot be imported in server runtime" error on fresh Nuxt install #348

@alkstal

Description

@alkstal

Version

nuxt-security: 1.0.0
nuxt: 3.9.3

Reproduction Link

https://github.com/johanalkstal/nuxt-security-repro

Steps to reproduce

Run pnpm install
Run pnpm run dev

What is Expected?

No errors

What is actually happening?

Nuxt 3.9.3 with Nitro 2.8.1                                                                                 3:41:14 PM
                                                                                                            3:41:14 PM
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

  ➜ DevTools: press Shift + Alt + D in the browser (v1.0.8)                                                 3:41:15 PM

ℹ Vite server warmed up in 870ms                                                                           3:41:17 PM
ℹ Vite client warmed up in 1043ms                                                                          3:41:17 PM

[3:41:17 PM]  ERROR  This module cannot be importedin server runtime. [importing @nuxt/kit from node_modules/.pnpm/[email protected]/node_modules/nuxt-security/dist/runtime/nitro/plugins/05-cspSsgPresets.mjs]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions