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

Application entry file "app\node\main.js" in the "**\app.asar" does not exist. Seems like a wrong configuration. #2107

Closed
apolkingg8 opened this issue Sep 23, 2017 · 9 comments
Labels

Comments

@apolkingg8
Copy link

  • Version: 19.27.7
  • Target: win
Packaging for win32 x64 using electron 1.7.6 to dist\win-unpacked
Error: Application entry file "app\node\main.js" in the "X:\MYPROJECT_PATH\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration.
    at error (X:\MYPROJECT_PATH\node_modules\electron-builder\src\util\asarUtil.ts:224:12)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\util\asarUtil.ts:250:11
From previous event:
    at checkFileInArchive (X:\MYPROJECT_PATH\node_modules\electron-builder\out\util\asarUtil.js:52:22)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\platformPackager.ts:305:13
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.checkFileInPackage (X:\MYPROJECT_PATH\node_modules\electron-builder\out\platformPackager.js:373:11)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\platformPackager.ts:353:16
    at Generator.next (<anonymous>)
    at X:\MYPROJECT_PATH\node_modules\graceful-fs\polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:114:15)
From previous event:
    at WinPackager.sanityCheckPackage (X:\MYPROJECT_PATH\node_modules\electron-builder\out\platformPackager.js:391:11)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\platformPackager.ts:198:16
From previous event:
    at WinPackager.doPack (X:\MYPROJECT_PATH\node_modules\electron-builder\out\platformPackager.js:251:11)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\platformPackager.ts:105:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (X:\MYPROJECT_PATH\node_modules\electron-builder\out\platformPackager.js:174:11)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\packager.ts:260:24
From previous event:
    at Packager.doBuild (X:\MYPROJECT_PATH\node_modules\electron-builder\out\packager.js:338:11)
    at X:\MYPROJECT_PATH\node_modules\electron-builder\src\packager.ts:186:52
    at Generator.next (<anonymous>)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Packager.build (X:\MYPROJECT_PATH\node_modules\electron-builder\out\packager.js:257:11)
    at Object.<anonymous> (X:\MYPROJECT_PATH\node_modules\electron-builder\src\builder.ts:286:40)
    at Generator.next (<anonymous>)
From previous event:
    at Object.build (X:\MYPROJECT_PATH\node_modules\electron-builder\out\builder.js:69:21)
    at webpack.run (X:\MYPROJECT_PATH\scripts\build.js:42:17)
    at emitRecords.err (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:269:13)
    at Compiler.emitRecords (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:368:12)
    at next (X:\MYPROJECT_PATH\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (X:\MYPROJECT_PATH\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at next (X:\MYPROJECT_PATH\node_modules\tapable\lib\Tapable.js:220:14)
    at callback (X:\MYPROJECT_PATH\node_modules\copy-webpack-plugin\dist\index.js:108:17)
    at Compiler.<anonymous> (X:\MYPROJECT_PATH\node_modules\copy-webpack-plugin\dist\index.js:131:13)
    at Compiler.applyPluginsAsyncSeries1 (X:\MYPROJECT_PATH\node_modules\tapable\lib\Tapable.js:222:13)
    at Compiler.afterEmit (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:365:9)
    at require.forEach.err (X:\MYPROJECT_PATH\node_modules\webpack\lib\Compiler.js:354:15)
    at X:\MYPROJECT_PATH\node_modules\async\dist\async.js:421:16
    at iteratorCallback (X:\MYPROJECT_PATH\node_modules\async\dist\async.js:998:13)
    at X:\MYPROJECT_PATH\node_modules\async\dist\async.js:906:16
    at X:\MYPROJECT_PATH\node_modules\graceful-fs\graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:114:15)

builder.build({
    targets: Platform.current().createTarget(),
    config: {
        npmRebuild: false,
        appId: 'com.kingapol.alice',
        asar: true,
        files: [{
            from: ".",
            to: ".",
            filter: ["package.json"]
        }, {
            from: path.join("app", "node"),
            to: path.join("app", "node"),
            filter: nodeModuleFilters
        }, {
            from: "temp",
            to: path.join("app", "render"),
            filter: ["index.bundle.js", "index.html"]
        }, {
            from: "temp",
            to: ".",
            filter: ["globalDefines.json"]
        }],
        win: {
            target: 'zip'
        }
    }
})

.gitignore
README.md
app/global.d.ts
app/node/DB.js
app/node/DB.js.map
app/node/DB.ts
app/node/main.js
app/node/main.js.map
app/node/main.ts
app/node/package.json
app/node/yarn.lock
app/render/Component/Hello.js
app/render/Component/Hello.js.map
app/render/Component/Hello.tsx
app/render/index.html
app/render/index.js
app/render/index.js.map
app/render/index.tsx
app/render/package.json
app/render/yarn.lock
globalDefines.json
package.json
scripts/build.js
tsconfig.json
webpack.config.js
yarn.lock

If I set asar: false, everything works fine. I found some issues but there solution not works with me. Any idea?

@apolkingg8
Copy link
Author

I tried asar e dist/win-unpacked/resources/app.asar dist/win-unpacked/resources/123 and it looks like this:

DB.js  
globalDefines.json 
index.bundle.js 
index.html  
main.js  
node_modules  
package.json

It looks like my dir structure changed... but I don't know why.

@develar
Copy link
Member

develar commented Sep 23, 2017

Is it possible to provide project, so, I can easily reproduce?

@apolkingg8
Copy link
Author

apolkingg8 commented Sep 23, 2017

@develar Sure! https://github.com/apolkingg8/temp

please try with npm run build

@apolkingg8
Copy link
Author

@develar can you reproduce this issue? it's a bug or I set something wrong?

@develar develar added the bug label Sep 25, 2017
develar added a commit to develar/electron-builder that referenced this issue Sep 25, 2017
develar added a commit to develar/electron-builder that referenced this issue Sep 26, 2017
develar added a commit to develar/electron-builder that referenced this issue Sep 26, 2017
@develar
Copy link
Member

develar commented Sep 26, 2017

@apolkingg8 Thanks for test project.

@apolkingg8
Copy link
Author

Thank you for this awesome project!

@develar
Copy link
Member

develar commented Sep 26, 2017

Hint — not clear for me for what do you need to execute npm rebuild. Also not clear for what do you need programmatic usage. Just use https://github.com/electron-userland/electron-webpack :)

@haykerman
Copy link

What if I don't use webpack? How can I configure electron-builder in that case?

@yexianli
Copy link

I meet the problem too, How to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants