agmmnn / tauri-controls

🚥 Native-looking window controls for Tauri 2. React, Solid, Vue, Svelte+Tailwind.
https://npmjs.com/package/tauri-controls
MIT License
581 stars 21 forks source link

error in production build #1

Closed agmmnn closed 11 months ago

agmmnn commented 11 months ago

Uncaught (in promise) Not allowed by the scope TypeError: Cannot read properties of null (reading 'useState')

Details index-c376e050.js:40 TypeError: Cannot read properties of null (reading 'useState') at Y.useState (index-c376e050.js:49:6350) at Qv (index-c376e050.js:58:32088) at zc (index-c376e050.js:38:19517) at W0 (index-c376e050.js:40:43915) at V0 (index-c376e050.js:40:39687) at Lg (index-c376e050.js:40:39615) at ml (index-c376e050.js:40:39470) at Rs (index-c376e050.js:40:35850) at D0 (index-c376e050.js:40:34801) at C (index-c376e050.js:25:1558) gs @ index-c376e050.js:40 index-c376e050.js:40 TypeError: Cannot read properties of null (reading 'useState') at Y.useState (index-c376e050.js:49:6350) at qv (index-c376e050.js:58:33843) at zc (index-c376e050.js:38:19517) at W0 (index-c376e050.js:40:43915) at V0 (index-c376e050.js:40:39687) at Lg (index-c376e050.js:40:39615) at ml (index-c376e050.js:40:39470) at Rs (index-c376e050.js:40:35850) at D0 (index-c376e050.js:40:34801) at C (index-c376e050.js:25:1558) gs @ index-c376e050.js:40 index-c376e050.js:40 TypeError: Cannot read properties of null (reading 'useState') at Y.useState (index-c376e050.js:49:6350) at Xv (index-c376e050.js:58:30923) at zc (index-c376e050.js:38:19517) at W0 (index-c376e050.js:40:43915) at V0 (index-c376e050.js:40:39687) at Lg (index-c376e050.js:40:39615) at ml (index-c376e050.js:40:39470) at Rs (index-c376e050.js:40:35850) at D0 (index-c376e050.js:40:34801) at C (index-c376e050.js:25:1558) gs @ index-c376e050.js:40 index-c376e050.js:40 Uncaught TypeError: Cannot read properties of null (reading 'useState') at Y.useState (index-c376e050.js:49:6350) at Qv (index-c376e050.js:58:32088) at zc (index-c376e050.js:38:19517) at W0 (index-c376e050.js:40:43915) at V0 (index-c376e050.js:40:39687) at Lg (index-c376e050.js:40:39615) at ml (index-c376e050.js:40:39470) at Rs (index-c376e050.js:40:35850) at D0 (index-c376e050.js:40:34801) at C (index-c376e050.js:25:1558) tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope tauri.localhost/:1 Uncaught (in promise) Not allowed by the scope

📷

agmmnn commented 11 months ago

I think it is due to my misconfigured tauri.conf.json file.🤦I added this rule and now it is ok.

"security": {
  "dangerousRemoteDomainIpcAccess": [
    {
      "scheme": "https",
      "domain": "tauri.localhost",
      "windows": ["main"],
      "plugins": ["os", "event", "window"]
    }
  ]
},

(the other react error message was just because of the wrong npm:link development import)