Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite fs allow not respecting individual files #5689

Closed
7 tasks done
skrenes opened this issue Nov 15, 2021 · 2 comments · Fixed by #12863
Closed
7 tasks done

Vite fs allow not respecting individual files #5689

skrenes opened this issue Nov 15, 2021 · 2 comments · Fixed by #12863
Labels
contribution welcome p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@skrenes
Copy link

skrenes commented Nov 15, 2021

Describe the bug

If I enter a file into the allow list, the logs show the Vite serving allow list properly, but Vite still reports the file "is outside of Vite serving allow list"

Reproduction

server: {
        fs: {
          allow: ['./$houdini', './houdini.config.js'],
        },
      },

Start server and I see this:

The request url "/home/node/app/houdini.config.js" is outside of Vite serving allow list.

- /home/node/app/static
- /home/node/app/src/lib
- /home/node/app/src/routes
- /home/node/app/src
- /home/node/app/.svelte-kit
- /home/node/app/node_modules
- /home/node/app/$houdini
- /home/node/app/houdini.config.js

Refer to docs https://vitejs.dev/config/#server-fs-allow for configurations and more details.

As you'll see, /home/node/app/houdini.config.js shows up in the allow list but Vite complains it's not in the allow list.

System Info

System:
    OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) x64 Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
    Memory: 3.68 GB / 31.25 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 17.1.0 - /usr/local/bin/node
    Yarn: 3.1.0 - /usr/local/bin/yarn
    npm: 8.1.2 - /usr/local/bin/npm

Used Package Manager

yarn

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Mar 30, 2022

IIRC fs.allow only works for directories, not files, and the documentation is a bit vague on this. But I think it make sense to support files as well though.

@bluwy bluwy added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 30, 2022
Ph0tonic added a commit to Ph0tonic/vite that referenced this issue Apr 14, 2023
@Ph0tonic
Copy link
Contributor

Hi,
I created a PR for this issue, see #12863.
Let me know what you think about it.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
contribution welcome p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants