Error when using `nApi` preview feature flag: `Can't modify an already connected engine.`
See original GitHub issueBug description
Hi. A while ago I made this issue about nApi. And because I couldn’t use it, I removed nApi from my project. But I started using it again a couple of days ago.
Since I started using it again. I haven’t had a problem with production and no errors like the issue above. But I started getting a new error in development on my own PC (windows 10).
Error:
(node:5568) UnhandledPromiseRejectionWarning:
Error: {
"is_panic":false,
"message":"Can't modify an already connected engine.",
"backtrace":" 0: napi_register_module_v1\n
1: napi_register_module_v1\n 2: napi_register_module_v1\n 3: <unknown>\n 4: <unknown>\n 5: <unknown>\n 6: <unknown>\n 7: <unknown>\n 8: <unknown>\n 9: napi_register_module_v1\n 10: napi_register_module_v1\n 11: napi_register_module_v1\n 12: napi_register_module_v1\n 13: napi_register_module_v1\n 14: napi_register_module_v1\n 15: napi_register_module_v1\n 16: napi_register_module_v1\n 17: napi_register_module_v1\n 18: napi_register_module_v1\n 19: napi_register_module_v1\n 20: BaseThreadInitThunk\n 21: RtlUserThreadStart\n"}
I use nodemon (v 2.0.9) with express (v 4.17.1).
My main database is Postgress (which I use Prisma for), and redis with node-redis (v 3.1.2) which runs in a windows Ubuntu (WSL) terminal.
I use the integrated git bash for vscode as my main terminal (where I run nodemon).
How to reproduce
- open an express project that uses postgress Prisma and nApi
- open git bash in vscode + ubuntu (WSL) terminal that runs redis with node-redis
- run the project with nodemon
- stop nodemon using CTRL+C
- start it immediately after
- see error
Expected behavior
Connect to the already existing engine instead of throwing this error.
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["selectRelationCount", "nApi"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
...
Environment & setup
- OS: Windows 10 Pro version 21H1
- Database: PostgreSQL 13
- Node.js version 14.17.2
- Nodemon version 2.0.9
- Git bash version 2.32.0.2
Prisma Version
prisma : 2.29.0
@prisma/client : 2.29.0
Current platform : windows
Query Engine : query-engine 1be4cd60b89afa04b192acb1ef47758a39810f3a (at node_modules\@prisma\engines\query-engine-windows.exe)
Migration Engine : migration-engine-cli 1be4cd60b89afa04b192acb1ef47758a39810f3a (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine : introspection-core 1be4cd60b89afa04b192acb1ef47758a39810f3a (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary : prisma-fmt 1be4cd60b89afa04b192acb1ef47758a39810f3a (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash : 1be4cd60b89afa04b192acb1ef47758a39810f3a
Studio : 0.419.0
Preview Features : selectRelationCount, nApi
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Enabling Node-API libraries: Remove `nApi` preview feature ...
Now when a user just installs and uses Prisma, they directly get the Node-API library instead of the binary everywhere. The preview feature...
Read more >Prisma Client and Prisma schema preview features
Enabling a Prisma Client preview feature. To enable a Prisma Client preview feature: Add the preview feature flag to the generator block:.
Read more >Feature flags - GitLab Docs
With feature flags, you can deploy your application's new features to production in smaller batches. You can toggle a feature on and off...
Read more >Feature Flags: The Hidden Switch Behind Continuous ...
Feature flags allows you to ship code more frequently, test on production, and wow your users by revealing the feature at the right...
Read more >Introducing AWS AppConfig Feature Flags In Preview
Update (15 March 2022): AWS AppConfig Feature Flags are now ... AWS customers use AWS AppConfig to centrally manage and deploy their ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I haven’t personally seen any reoccurrence of this either. I’ll reopen another issue if it happens again.
That’s fine, thanks for letting us know. We will see if we can get this fixed (or worked around).