Closed masteradit closed 3 years ago
Try adding --verbose
to your flutter run
command to see if it reports any errors.
If you run from the IDE, you might have a way to specify command line parameters, I happen to use Android Studio and it's in Run > Edit Configurations there, that's probably the same in all JetBrains-based IDEs, I don't know about VS Code.
I think I'm on to something. Check out the browser dev tools, Sources tab:
require.js
is there but the main one, sqflite_web.js
is missing.
Does it run for you now?
Note that I had to modify index.html
(it called require.js
no matter what). You might need to do it in your own app if you modified it similarly.
Try adding
--verbose
to yourflutter run
command to see if it reports any errors.
I tried doing it after pulling the recent commits. Here are the things I noticed:
require.js
but sqflite_web.js
is still missing in the Sources tab.<script src="assets/packages/sqflite_web/assets/require.js" type="application/javascript"></script>
from index.html
, it started working! I also got this warning in the output:<!> WARNING: Importing 'require.js' from sqlite_web, consider importing it directlty from your html file like this: '<script
src="assets/packages/sqflite_web/assets/require.js" type="application/javascript"></script>'
That's not the latest one, try to upgrade or download it again. Now it never mentions the require.js
in this context. Yes, it should start with the line from index.html
removed but the final solution is the latest commit up here.
Got it! I am not sure why flutter pub get
did not automatically get the latest version, but I manually deleted a few lines in pubspec.lock
and ran flutter pub get
again to get the latest version. It is running in debug mode and shows this warning:
WARNING: Importing 'sqflite_web.js' from sqlite_web, consider importing it directly from your html file like this: '<script src="assets/packages/sqflite_web/assets/sqflite_web.js" type="application/javascript"></script>'
Yes, that's normal. It will keep showing this, it's just a suggestion that you can accept or not. It's up to you.
In theory, I'd prefer it to be automatic like this, adding itself, without the need to modify index.html
ever. This is how I did it originally, However, a contributor noted that this automatic insertion doesn't play nice with hot restarts (see the discussion in https://github.com/deakjahn/sqflite_web/pull/13) and that's why the warning was added.
Actually, now that I checked, it was that PR that introduced require.js
to be present in index.html
. Well, it seems that it had been working that way until now, maybe the newer Flutter 2.5 broke it? Anyway, now I removed that from the README as well, just to be sure. You might add sqflite_web.js
manually but you definitely don't want to add require.js
any more.
Cool! The discussion looks a bit more technical than what I can understand right now, so I will check it out later 😅
Thanks a lot for fixing both the issues I created!
For some reason, after adding
sqflite_web
, my app just stopped working in debug mode. When I run it, it gets stuck onWaiting for connection from debug service from Chrome
.The source code for my project is available here: https://github.com/masteradit/AllSQL