Comments (14)
https://stackoverflow.com/a/60845153 suggests that preload.js
now needs to be included in extraResources
or one of the other similar keys.
from datasette-app.
https://www.electronjs.org/docs/latest/tutorial/tutorial-preload
Relevant code:
Lines 469 to 477 in 6de9080
from datasette-app.
https://www.electron.build/configuration/contents#files - maybe adding it to "files"
could help, e.g. this app does that: https://github.com/tencentyun/TRTCSDK/blob/7b1578a21cad7d16fcb57664e1ee7a34b0fa1b1d/Electron/TRTC-API-Example/package.json#L47
from datasette-app.
I grabbed the app.asar
file from the latest build and extracted it:
npx asar extract app.asar .
Got this:
drwxr-xr-x 3 simon wheel 96B Feb 16 20:14 .github
-rw-r--r-- 1 simon wheel 3.5K Feb 16 20:14 README.md
-rw-r--r--@ 1 simon wheel 3.1M Feb 16 20:13 app.asar
-rw-r--r-- 1 simon wheel 397B Feb 16 20:14 did-fail-load.html
-rwxr-xr-x 1 simon wheel 521B Feb 16 20:14 download-python.sh
-rw-r--r-- 1 simon wheel 4.3K Feb 16 20:14 loading.html
-rw-r--r-- 1 simon wheel 32K Feb 16 20:14 main.js
drwxr-xr-x 13 simon wheel 416B Feb 16 20:14 node_modules
-rw-r--r-- 1 simon wheel 432B Feb 16 20:14 package.json
-rw-r--r-- 1 simon wheel 3.9K Feb 16 20:14 progress.html
-rw-r--r-- 1 simon wheel 10B Feb 16 20:14 requirements.txt
drwxr-xr-x 3 simon wheel 96B Feb 16 20:14 scripts
-rw-r--r-- 1 simon wheel 169B Feb 16 20:14 server-log-preload.js
-rw-r--r-- 1 simon wheel 649B Feb 16 20:14 server-log.html
drwxr-xr-x 3 simon wheel 96B Feb 16 20:14 test
drwxr-xr-x 3 simon wheel 96B Feb 16 20:14 test-videos
Not sure why all of that stuff is in there but preload.js
is not.
Also don't want the test-videos
folder in there! That's the video generated during CI runs.
from datasette-app.
It would be useful if I could run a build on my laptop instead of just in CI.
Adding this to "build"
in package.json
almost but didn't quite fix that:
"mac": {
"target": {
"target": "default",
"arch": [
"x64"
]
},
from datasette-app.
New theory:
I think it's down to this line in preload.js
:
Line 2 in c644359
Electron v20 changes the default setting for sandboxing renderers with preload scripts to true. This means you need to set the sandbox: false option on your BrowserWindow to access Node APIs in your preload.
from datasette-app.
The built package still doesn't have preload.js
in its app.asar
file for some reason.
from datasette-app.
Possibly relevant: https://stackoverflow.com/questions/70175316/electron-unable-to-load-preload-script-resources-app-asar-src-preload-js
from datasette-app.
npx asar extract app.asar app
That confirms that the preload.js
script is NOT in that archive - which is weird, because other files like server-log-preload.js
ARE included in that archive.
from datasette-app.
After much mucking around locally it looks like adding preload.js
to that list did at least convince it to be included in the app.asar
file.
from datasette-app.
That fixed it! The build generated by https://github.com/simonw/datasette-app/actions/runs/4277650268 worked correctly.
from datasette-app.
I grabbed a copy of that build and saved it here - once a few more people have tested I'll ship it as a new release. https://static.simonwillison.net/static/2023/feb-26-datasette-desktop/Datasette.app.zip
from datasette-app.
Asked for help testing this in https://discord.com/channels/823971286308356157/823971286941302908/1079616010069495829
from datasette-app.
OK, I'm going to ship it.
from datasette-app.
Related Issues (20)
- Can't "go back" after choosing view as JSON or CSV and saving/storing queries in underlying SQLite
- Allow for load / open of data from URL where CSV (or JSON?) is compressed
- Allow handling of larger CSV files e.g. CFPB complaints data HOT 1
- Switch to Playwright for automated tests HOT 28
- Failing to render in retina resolution when running on my MacBook Pro (macOS Catalina) HOT 1
- Research faster launch times
- Mechanism for plugins that need a specific DB HOT 3
- "Loading..." hangs on launch after parsing "tag_name" in a plugin HOT 6
- npm test is failing HOT 2
- All sorts of features not working due to bad HTTP requests HOT 9
- London Fire Brigade demo breaks HOT 7
- Import CSV from URL should show errors
- New Playwright tests should exercise key features
- Ability to use templates
- The icon looks blurry in the alt-tab window
- Loading... hangs on launch with packaging.version.InvalidVersion HOT 6
- "About Datasette" button fails to open information window HOT 2
- Global Power Plant database is not found. HOT 1
- plugin menu throws '500' error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette-app.