Skip to content

Commit

Permalink
Merge pull request #92 from zmzimpl/dev
Browse files Browse the repository at this point in the history
尝试调试 window-addon 加载错误的问题
  • Loading branch information
zmzimpl authored Feb 25, 2025
2 parents f1d8dcb + a1be8d9 commit e8f42eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,9 @@ jobs:
if [ "${{ matrix.platform }}" == "mac-arm64" ]; then
echo "Building native modules for ARM64"
npm run build:native-addon:mac-arm64
npm run rebuild-deps:mac-arm64
elif [ "${{ matrix.platform }}" == "mac-x64" ]; then
echo "Building native modules for x64"
npm run build:native-addon:mac-x64
npm run rebuild-deps:mac-x64
fi
# 检查编译的模块
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"main": "packages/main/dist/index.cjs",
"scripts": {
"build:native-addon": "cd ./packages/main/src/native-addon && node-gyp clean && node-gyp configure && node-gyp build",
"build:native-addon:mac-x64": "cd ./packages/main/src/native-addon && node-gyp clean && SDKROOT=$(xcrun --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=10.13 node-gyp rebuild --arch=x64",
"build:native-addon:mac-arm64": "cd ./packages/main/src/native-addon && node-gyp clean && SDKROOT=$(xcrun --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=10.13 node-gyp rebuild --arch=arm64",
"build:native-addon:mac-x64": "cd ./packages/main/src/native-addon && node-gyp clean && node-gyp configure && node-gyp build --arch=x64",
"build:native-addon:mac-arm64": "cd ./packages/main/src/native-addon && node-gyp clean && node-gyp configure && node-gyp build --arch=arm64",
"build": "npm run build:main && npm run build:preload && npm run build:renderer",
"build:main": "cd ./packages/main && vite build",
"build:preload": "cd ./packages/preload && vite build",
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/services/sync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ if (!app.isPackaged) {
try {
addon = require(addonPath);
} catch (error) {
console.error('Failed to load addon:', error);
console.error('Attempted path:', addonPath);
console.error('Process arch:', process.arch);
logger.error('Failed to load addon:', error);
logger.error('Attempted path:', addonPath);
logger.error('Process arch:', process.arch);
}
}

export const initSyncService = () => {
if (!addon) {
logger.error('Window addon not loaded properly');
logger.error('Window addon not loaded properly', process.resourcesPath);
return;
}

Expand Down

0 comments on commit e8f42eb

Please sign in to comment.