tauri fs APIs not working
See original GitHub issuei am using this vue plugin for testing tauri out. Not sure if the issue is with tauri core of this plugin.
I have a simple js file that has following
import { readDir } from "tauri/api/fs";
readDir(".").then(d => {
console.log(d)
})
export default 1;
the default export is just so that I can import this file in my App.vue
and nothing else. intellisense shows that this code is correct and I can navigate through it as well, but after running it with yarn tauri:serve
I get following error
CONSOLE LOG [HMR] Waiting for update signal from WDS...
undefined:73:56: CONSOLE ERROR TypeError: undefined is not an object (evaluating '_tauri__WEBPACK_IMPORTED_MODULE_0__["default"].readDir')
CONSOLE INFO Download the Vue Devtools extension for a better development experience:
This is the entire error unfortunately, there’s no stack trace or anything.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
fs
This module prevents path traversal, not allowing absolute paths or parent dir components (i.e. "/usr/path/to/file" or "../path/to/file" paths are not allowed).
Read more >tauri-apps/api
@tauri-apps/api. Modules. app · cli · clipboard · dialog · event · fs · globalShortcut · http · mocks · notification · os...
Read more >Embedding Additional Files
It supports glob patterns in case you need to include multiple files from a directory. Here is a sample to illustrate the configuration....
Read more >Configuration
Enables the transparent background API and sets the fullScreenEnabled preference ... when it's not in focus https://github.com/tauri-apps/tauri/issues/4316.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just realizing now that you are on linux, idk why I thought windows. But I also tried on windows and it worked fine. I’m not sure why you are getting the issue, but another tauri release has been published so maybe try that.
We’re seeing some cases where you have to manually remove
src-tauri/target
.