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

cannot load @rpath/QtSvgWidget on v0.62.0 on m1 mac #1030

Open
richardwzp opened this issue Oct 7, 2023 · 1 comment
Open

cannot load @rpath/QtSvgWidget on v0.62.0 on m1 mac #1030

richardwzp opened this issue Oct 7, 2023 · 1 comment

Comments

@richardwzp
Copy link

richardwzp commented Oct 7, 2023

Describe the bug
I'm on m2 mac ventura. I was trying to replicate the example in nodegui-starter. When using the version that nodegui-starter uses, which is 0.57.1, everything works fine and the window pop up. When I upgraded the version to 0.62, I see the following error:

node:internal/modules/cjs/loader:1243
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: dlopen(playground/dist/nodegui_core-26371d0561563ceb57635e21a1adede6.node, 0x0001): Library not loaded: @rpath/QtSvgWidgets.framework/Versions/A/QtSvgWidgets
  Referenced from: <5DAAA9E5-0A01-35F7-ADD6-D122D6316A70> playground/dist/nodegui_core-26371d0561563ceb57635e21a1adede6.node
  Reason: tried: 'playground/dist/../../miniqt/6.4.1/macos/lib/QtSvgWidgets.framework/Versions/A/QtSvgWidgets' (no such file), 'playground/dist/../../miniqt/6.4.1/macos/lib/QtSvgWidgets.framework/Versions/A/QtSvgWidgets' (no such file), '/Library/Frameworks/QtSvgWidgets.framework/Versions/A/QtSvgWidgets' (no such file), '/System/Library/Frameworks/QtSvgWidgets.framework/Versions/A/QtSvgWidgets' (no such file, not in dyld cache)
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at eval (webpack:///./node_modules/@nodegui/nodegui/build/Release/nodegui_core.node?:1:18)
    at ./node_modules/@nodegui/nodegui/build/Release/nodegui_core.node (/Users/wzp/Documents/academics/Academic study 2022-2023/CS4500/mysterious-sharks/playground/dist/main.js:2654:1)
    at __webpack_require__ (/Users/wzp/Documents/academics/Academic study 2022-2023/CS4500/mysterious-sharks/playground/dist/main.js:3161:42)
    at eval (webpack:///./node_modules/@nodegui/nodegui/dist/lib/utils/addon.js?:3:15)
    at ./node_modules/@nodegui/nodegui/dist/lib/utils/addon.js (/Users/wzp/Documents/academics/Academic study 2022-2023/CS4500/mysterious-sharks/playground/dist/main.js:2571:1) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.12.1

To Reproduce
Steps to reproduce the behavior:

  1. I use the following config files, and everything else down to index.ts are the same as the nodegui-starter.
    webpack config
{
  "scripts": {
    "build": "webpack --config webpack.config.js --mode development",
    "dev": "npm run build && node dist/main.js",
    "test": "vitest --run --silent=false",
    "lint": "eslint --ext .js,.jsx ./Common/*",
    "lint-fix": "eslint --fix --ext .js,.jsx ./Common/*"
  },
  "dependencies": {
    "@nodegui/nodegui": "^0.62.0",
    "@types/stream-json": "^1.7.3",
    "stream": "^0.0.2",
    "stream-json": "^1.8.0",
    "ts-loader": "^9.4.4",
    "vitest": "^0.34.5"
  },
  "devDependencies": {
    "file-loader": "^6.2.0",
    "native-addon-loader": "^2.0.1",
    "@nodegui/packer": "^1.5.0",
    "@types/lodash": "^4.14.199",
    "@typescript-eslint/eslint-plugin": "^6.7.3",
    "@typescript-eslint/parser": "^6.7.3",
    "eslint": "^8.50.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-config-standard-with-typescript": "^39.1.0",
    "eslint-plugin-import": "^2.28.1",
    "eslint-plugin-n": "^16.1.0",
    "eslint-plugin-promise": "^6.1.1",
    "eslint-plugin-react": "^7.33.2",
    "lodash": "^4.17.21",
    "prettier": "^3.0.3",
    "typescript": "^5.2.2",
    "webpack": "^5.88.2",
    "webpack-cli": "^5.1.4",
    "clean-webpack-plugin": "^4.0.0"
  }
}

tsconfig:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "noImplicitAny": true,
    "module": "ES2020",
    "target": "ES2020",
    "allowJs": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "strictNullChecks": true,
    "outDir": "dist",
    "typeRoots": [
      "./node_modules/@types"
    ],
    "paths": {
      "@common/*": [
        "./Common/*"
      ],
      "@map-components/*": [
        "./Common/mapComponents/*"
      ]
    }
  },
  "include": [
    "src",
    "assets.d.ts",
    "**/*"
    // another includes
  ],
  "exclude": [
    "node_modules",
    "dist",
    "**/*.spec.ts",
    "webpack.config.js",
    ".prettierrc.js",
    ".eslintrc.js",
    ".babelrc.js",
    ".vitest.config.js",
  ],
}
  1. run npm run build after installing
  2. the error appears when I run npx qode dist/main.js

Expected behavior
When I downgrade my nodegui version, this bug goes away.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac m2 Ventura 13.5
  • NodeGUI 0.62

Additional context

@pabloromStrivelabs
Copy link

Describe the bug

I'm on intel mac Monterey 12.6.3. I was trying to replicate the example in nodegui-starter. I've upgraded the version to 0.62, I see the following error:

Error: dlopen(/Users/mac/Downloads/nodegui-starter/dist/nodegui_core-2c9dcae924e108484f5c27be2b6256fc.node, 0x0001): Library not loaded: '@rpath/QtSvgWidgets.framework/Versions/A/QtSvgWidgets'

Node.js v18.12.1 and also tested on v.16.8.0

To Reproduce
Steps to reproduce the behavior:

I use the following config files, and everything else down to index.ts are the same as the nodegui-starter.

webpack config

const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");

module.exports = {
  mode: process.NODE_ENV || "development",
  entry: "./src",
  target: "node",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "index.js",
  },
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        use: "ts-loader",
        exclude: /node_modules/,
      },
      {
        test: /\.(png|jpe?g|gif|svg|ico)$/i,
        use: [
          {
            loader: "file-loader",
            //options: { publicPath: "dist" },
          },
        ],
      },
      {
        test: /\.node$/,
        use: [
          {
            loader: "native-addon-loader",
            options: { name: "[name]-[hash].[ext]" },
          },
        ],
      },
    ],
  },
  resolve: {
    extensions: [".tsx", ".ts", ".js", ".jsx"],
  },
  plugins: [new CleanWebpackPlugin()],
};

tsconfig:


{
  "compilerOptions": {
    "incremental": true,
    "target": "es2016",
    "module": "commonjs",
    "allowJs": true,
    "checkJs": false,
    "outDir": "./dist",
    "sourceMap": true,
    "strict": true,
    "alwaysStrict": true,
    "moduleResolution": "node",
    "esModuleInterop": true
  },
  "include": ["**/*"]
}

package.json:


{
  "name": "nodegui-starter",
  "version": "1.0.0",
  "main": "index.js",
  "author": "Atul R <atulanand94@gmail.com>",
  "license": "MIT",
  "private": true,
  "scripts": {
    "build": "webpack --mode production",
    "start": "webpack && qode ./dist/index.js",
    "debug": "webpack && qode --inspect ./dist/index.js"
  },
  "dependencies": {
    "@nodegui/nodegui": "0.57.1",
    "@nodegui/os-utils": "^1.1.2"
  },
  "devDependencies": {
    "@nodegui/packer": "^1.5.0",
    "@types/node": "^18.7.14",
    "clean-webpack-plugin": "^4.0.0",
    "file-loader": "^6.2.0",
    "native-addon-loader": "^2.0.1",
    "ts-loader": "^9.3.1",
    "typescript": "^4.8.2",
    "webpack": "^5.74.0",
    "webpack-cli": "^4.10.0"
  }
}

We've fixed it by following these steps #1004

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