Your problem is documented here: By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. My requirement is to upload a local file. Therefore, if the js file that will kick things off is "main.js" then "main": "main.js" is correct. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. I am experiencing the problem on macOS 10.14.6. When the file protocol is used to load the page, the local audio file can be loaded normally. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Why are non-Western countries siding with China in the UN? Asking for help, clarification, or responding to other answers. The text was updated successfully, but these errors were encountered: Try this as an alternative way to get around this path issue: @shama Thanks for snippet. I tried to set: process.traceProcessWarnings = true but this does not help. Like 1/20 attempts will work. Just replace htmlRootDir and/or indexFile for your expectations. And if you switch to v1.1.3 of Electron in my code, the error will disappear. It can't work well when I upgrade the 9.0.0 version on Mac. Quite often the problems are caused by malformed kubeconfig which the application tries to load. rev2023.3.1.43269. The tag and the image will show up fine. , , , but I get this error: And upgrade to electron 9, all of images could NOT be loaded. Platform: Windows 10 / Linux(Ubuntu 18.10), repro: https://github.com/lyswhut/test-load-local-file. Do following changes in main.js file, mainWindow = new BrowserWindow({width: 1100, height: 700, icon: __dirname + '/icon.ico'}) mainWindow.loadURL(url.format({ pathname:'index.html', protocol: 'file', slashes: true })), app.on('ready', () => { protocol.interceptFileProtocol('file', (request, callback) => { const url = request.url.substr(7) /* all urls start with 'file://' */ callback({ path: path.normalize(${__dirname}/${url})}) }, (err) => { if (err) console.error('Failed to register protocol') }) createWindow() /* callback function */ }), app.on('ready', () => { protocol.interceptFileProtocol('file', (request, callback) => { const url = request.url.substr(7) /* all urls start with 'file://' */ callback({ path: path.normalize(${__dirname}/${url})}) }, (err) => { if (err) console.error('Failed to register protocol') }) createWindow() /* callback function */ }), Path issue. @pcharisius @LoganDark Try with something like this: @pcharisius @LoganDark Try with something like this: @LoganDark These mesages are normal, are warnings. The issue as I encountered it (described above) was fixed on Electron 1.3.2, // If this is defined within the `watcher.on('ready')` the error will return, // Defined outside the chokidoar callback. Connect and share knowledge within a single location that is structured and easy to search. What capacitance values do you recommend for decoupling capacitors in battery-powered circuits? 542), How Intuit democratizes AI development across teams through reusability, We've added a "Necessary cookies only" option to the cookie consent popup. Ok, the build AppImage does not like links like , but href="javascript:;" is fine. It currently makes custom protocols unusable, as you can't load any proper website with it. How do I turn a C# object into a JSON string in .NET? It'll always show DevTools failed to load SourceMap: Could not load content for file:///C:/User./resources/app.asar/bootstrap.min.css.map. net::ERR_FILE_NOT_FOUND, /favicon.ico:1 Failed to load resource: net::ERR_FILE_NOT_FOUND. Sign in My application has a custom "res://" protocol. Every time I open devtools, I get this: I had that error and it was related to allowFileAccess property. "seed-min.js:70 GET file:///D:/tools/develop/nodejs/node_modules/.electron_npminstall/node_modus,anim/base-min.js,promise-min.js,anim/timer-min.js,anim/transition-min.js net::ERR_FILE_NOT_FOUND". whenever I add an image using "CSS" it throws this error. Here is the repo for this bug: https://github.com/jwu/electron-custom-protocol-bug, just follow the README in this repo you will see the error. Are you sure you have updated your code properly? Perhaps this might help . Sign in Asking for help, clarification, or responding to other answers. Has 90% of ice around Antarctica disappeared in less than a decade? If the app folder is the application root, as it is for our application, set the href value exactly as shown here. I can't get it to duplicate with my test application, but I did find some sort of cause in my main application. You'll need to switch back and forth as you go from working directly in electron and working on dev server (The reason i do this is to do css work, I find the dev server faster and more stable). Decided to remake my application in React. this didn't worked for me, app works fine with ng serve command. It looks like all parsing is delegated to blink; it seems strange that there is an edge case like this. Please paste them here: Kubeconfig: i try to registerFileProtocol but still not working, still does not display local image if url contains question mark, such as 'file:///c:/images/clock.jpg?time=16'. Fetch API cannot load file:///data/user//com.testapp/files//admin/images/question-paper/class-10/Mathematics/2011/Class%20X%202011.pdf. ERROR_WRONG_DISK 34 (0x22) The wrong diskette is in the drive. @ethan-ou's solution works except with some special characters. Torsion-free virtually free-by-cyclic groups, Parent based Selectable Entries Condition. I successfully replicated the problem with https://github.com/lyswhut/test-load-local-file. Well occasionally send you account related emails. Then I realized this bug is not important, because the map file is indeed imported. I think this package approach should be taken in consideration like some electronBasePath on package.json. did you find a workaround for the problem yet? On the web this makes sense, but in Electron we usually load files directly from the file system. You can see my working code, a
Will Lifetime Fitness Go Back To 24 Hours,
Who Did Ernie Lively Play In The Waltons,
Caterpillar Red Oil Dye,
Abandoned Places In Texas Near Me,
Articles E
electron failed to load url file with error err_file_not_found