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

Directory is not packaged in mac universal build #8085

Closed
ttpssabc opened this issue Feb 27, 2024 · 2 comments
Closed

Directory is not packaged in mac universal build #8085

ttpssabc opened this issue Feb 27, 2024 · 2 comments

Comments

@ttpssabc
Copy link

  • Electron-Builder Version: 24.12.0
  • Node Version: v21.5.0
  • Electron Version: 29.0.1
  • Electron Type (current, beta, nightly): current
  • Target: mac/universal

The structure of my Electron project is as follows:

├── css
│   ├── v1 -> v1.1
│   └── v1.1
│       └── style.css
├── index.html
├── index.js
├── package.json
└── yarn.lock

In the css directory, there exists a subdirectory named v1.1, which is pointed to by a symbolic link named v1. The index.html file references css/v1/style.css to load the stylesheet.

Problem

When I build the project with the target set to mac/universal, I encounter the error "Failed to load resource: net::ERR_FILE_NOT_FOUND" while loading the stylesheet. I unpack the app.asar and find out that the v1.1 directory is missing while the symbolic link v1 exists. I attempted to build the project targeting mac/arm64 or mac/x64, and encountered no issues. From my observations, it appears that the problem occurs only when there is a symbolic link pointing to a directory whose name contains a dot (.), and the target is set to mac/universal.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 1, 2024

So, all electron-builder is doing is using @electron/universal package to stitch together the compiled asars. I'd recommend opening an issue there describing your issue, as I don't think there's something we can do from electron-builder side if your individual arm64 and x64 builds are working correctly?

const { makeUniversalApp } = require("@electron/universal")
await makeUniversalApp({
x64AppPath: path.join(x64AppOutDir, appFile),
arm64AppPath: path.join(arm64AppOutPath, appFile),
outAppPath: path.join(appOutDir, appFile),
force: true,
mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,
singleArchFiles: platformSpecificBuildOptions.singleArchFiles,
x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,
})

@ttpssabc
Copy link
Author

ttpssabc commented Mar 4, 2024

Thanks for the information! I found out the root cause is from electron/asar#303

@mmaietta mmaietta closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants