jpkleemans / vite-svg-loader

Vite plugin to load SVG files as Vue components
MIT License
557 stars 59 forks source link

Vite Error: Unrestricted file system access ... #28

Closed madebyfabian closed 2 years ago

madebyfabian commented 2 years ago

Hey there, thanks for creating this plugin. Exactly what I needed. There is just an error on every dev-server startup that notifies me that this package will break in future vite versions because of file system access. The error message:

Unrestricted file system access to "/notes/function render(_ctx, _cache) {  return (_openBlock(), _createElementBlock("svg", _hoisted_1, _hoisted_3))}"
For security concerns, accessing files outside of serving allow list will be restricted by default in the future version of Vite. Refer to https://vitejs.dev/config/#server-fs-allow for more details.

Now everything works. But I guess this is not something to ignore.

madebyfabian commented 2 years ago

Have to add something, it's only when I do

<img src="@/assets/images/logo.svg">

directly, without import in JS.

jpkleemans commented 2 years ago

Hi, thanks for reporting. I can't reproduce the message. Could you maybe share your project (or a test project), so I can investigate.

madebyfabian commented 2 years ago

@jpkleemans Thanks for your answer. If I use the plugin as the docs tell me to, everything works fine. It's just that direct <img src="@/assets... does not work. Will close this :)