electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 97 forks source link

can`t used local media file #206

Closed kimorkim closed 7 years ago

kimorkim commented 7 years ago

We are creating several media manipulation programs.(ex. image, sound)

I can`t get it to use image or audio tags.

The error message is as follows.

Thu, 16 Mar 2017 01:48:37 GMT electron-compile:protocol-hook Failed to compile C:/Users/entry_pc/Documents/entry-offline/out/Entry-win32-x64/resources/temp/fb/8e/image/fb8ef2ebe407eb2f9f86585609222f70.png: Asked for C:/Users/entry_pc/Documents/entry-offline/out/Entry-win32-x64/resources/temp/fb/8e/image/fb8ef2ebe407eb2f9f86585609222f70.png but it was not precompiled!
Error: Asked for C:/Users/entry_pc/Documents/entry-offline/out/Entry-win32-x64/resources/temp/fb/8e/image/fb8ef2ebe407eb2f9f86585609222f70.png but it was not precompiled!
    at FileChangedCache.getCacheEntryForPath (C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:218:15)
    at C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:127:41
    at next (<anonymous>)
    at step (C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:27:191)
    at C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:27:437
    at C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:27:99
    at FileChangedCache.getHashForPath (C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\file-change-cache.js:177:7)
    at C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\compiler-host.js:284:51
    at next (<anonymous>)
    at step (C:\Users\entry_pc\Documents\entry-offline\out\Entry-win32-x64\resources\app.asar\node_modules\electron-compile\lib\compiler-host.js:47:191)

any way to use local media files?

kimorkim commented 7 years ago

more infomation.

works for me.

const image = new Image();
image.onerror = function(){
    console.log('err');
};
image.onload = function() {
    console.log('load');
};
image.src = (inside asar file)

don`t work.

const image = new Image();
image.onerror = function(){
    console.log('err');
};
image.onload = function() {
    console.log('load');
};
image.src = (outside asar file) // ex. C:\\Users\\entry_pc\\Pictures\\1.png
MarshallOfSound commented 7 years ago

@kimorkim See https://github.com/electron/electron-compile/pull/199

kimorkim commented 7 years ago

thanks @MarshallOfSound

I'll wait for the pull request to merge.

And I'll close this issue and check out electron-userland/electron-forge#153 issues.