-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
"Uncaught Error: Received packet in the wrong sequence" with devtools off - Electron + MySQL node driver + Webpack #1548
Comments
Hm. I have never used any of those tools, so would have no idea why you would need |
Hi, The last couple days I have made some further testing. What I have realized is that if the MySQLjs module goes trough Webpack (used to bundle up dependencies), it won't survive. How I got to this conclusion: first I have placed the myslqjs module import into my home.js file (renderer process) and not the main process (index.js), because I needed a single query in my app, and I wanted to skip Inter Process Communication for this simple task. When I bundle up my app using Webpack, everything that is not inside the main process (index.js) get moved into the single bundle.js file including the content of home.js. With the option devtools = '', webpack disables source maps in the production build, while in dev mode it uses devtools = '#eval-source-map" which executes all modules (including mysqlj) via eval(), this evaluates the result of the module and I guess it surpresses warnings like the above mentioned. The point is that there is a glitch in Webpack + mysqlj when queries are made in the renderer process. I would gladly help to find a fix for this, if you want. |
Sure! I have never used webpack, so simply unfamiliar. A PR with a fix will be very helpful to others experiencing the same issue (though you're the first to report that I know of). |
I was inspecting the issue, placing some brakepoints, etc., but so far didn't find a clue. Till than please try this, I have put together a working example, details you will find in the README file: |
Thanks, @vedtam ! I can take a look at this in a few weeks if no one else gets to it before me :) |
Hi @vedtam I'm sorry I never got around to this. I just went to look at your repo and it seems like it's gone. I'm not sure if I can really do anything, so especially without that repo any longer, I'm going to close this issue. If you can even provide a PR to fix this, that would be great! |
it is a bug with uglifyjs mangling |
Hi @akleiber do you think this is something that can be fixed here? If you can even provide a PR to fix this, that would be great! |
Hi @dougwilson - I have no clue what line of code in mysqljs causes the issue - just wanted to drop this here in case somebody needs a quickfix. |
@wenisy yes - this is the solution we use currently - thx for clarification :-) |
I have faced the same problem when bundling with web pack. at last i have solved the issue. |
When I set up a new project using Electron + Webpack + node MySQL my production build is throwing:
The error goes away only if I keep:
config.devtools = 'eval'
in my production builds, apparently this will result in a larger file size and some performance issues which I would like to avoid.Why my project / mysql module crashes with
devtools
set to''
?? I can hardly find similar reports, am I the only one having this issue?webpack.config.js:
home.js:
source of the error in mysql/lib/protocol/Protocol.js at line 272:
The text was updated successfully, but these errors were encountered: