Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(vite): enable fs strict mode - #8674

Merged
pi0 merged 2 commits into
mainfrom
fix/vite-fs-strict
Nov 3, 2022
Merged

fix(vite): enable fs strict mode#8674
pi0 merged 2 commits into
mainfrom
fix/vite-fs-strict

Conversation

@pi0

@pi0pi0 commented Nov 3, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Enable vite fs restriction by default. This ensures avoiding access to fs using /_nuxt/@fs/ url.

Read more: https://vitejs.dev/config/server-options.html#server-fs-strict).

This PR might introduce issues with modules trying to access outside of rootDir, srcDir, buildDir, workspaceDir or either of modulesDir (modules are automatically added). In this case, can be manually added using nuxt.options.vite.server.fs.allow[]

exportdefaultdefineNuxtConfig({vite: {server: {fs: {allow: ['/xyz']}}}})

Credits to @OhB00 for discovering this.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify

netlifyBot commented Nov 3, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitbf0013e
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/6364382b6c5da00009cff70c

@pi0
pi0 merged commit 44b4100 into mainNov 3, 2022
@pi0
pi0 deleted the fix/vite-fs-strict branch November 3, 2022 22:03
@pi0pi0 mentioned this pull request Nov 3, 2022
@TheAlexLichter

Copy link
Copy Markdown
Member

This only has impact in dev mode, right?

@OhB00

OhB00 commented Nov 4, 2022

Copy link
Copy Markdown
Contributor

This only has impact in dev mode, right?

Correct, you can read the full report on huntr when it is published.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@pi0@TheAlexLichter@OhB00@danielroe