Closed chopfitzroy closed 7 years ago
How do you build the app? There is currently no build-script in the electron-example.
Hey @pubkey,
I am using electron-builder relevant package.json
info below:
{
"main": "electron/index.js",
"scripts": {
"app:prod": "build -wl",
},
"license": "MIT",
"build": {
"files": [
"electron",
"node_modules"
],
"linux": {
"target": [
"AppImage"
]
},
"win": {
"target": [
"nsis"
]
}
},
"devDependencies": {
"electron": "^1.4.15",
"electron-builder": "^14.1.1",
"electron-devtools-installer": "^2.1.0",
}
}
I am wondering if it may be something to do with webpack building the scripts but I am just using babel as per the examples so I can't see why that would effect it?
Had a quick look at the source here is what babel is rendering:
{
name: "assignments",
schema: {
title: "Assignment Schema",
description: "Describes an assignment",
version: 0,
type: "object",
properties: {
name: {
type: "string",
primary: !0
},
curriculum: {
type: "string"
},
year: {
type: "integer"
}
},
required: ["curriculum", "year"]
},
sync: !0
}
The schema from babel looks ok. I don't know how I should reproduce this error. Maybe you can edit our electron-example in a way to reproduce the error.
Hey @pubkey,
I had similar thoughts I will put together a minimal working example hopefully tonight and that should let me know if it is some 3rd party lib interfering or if it is actually an rxdb bug.
Will add a link to the repo once I have it up.
Cheers.
Hi @CrashyBang Any update on this?
Hey @pubkey sorry have been slammed at work and haven't even had a chance to begin to debug this :L hope to be onto it some time this week.
Cheers.
Same error with react-native, on release mode only
Same issue with @CrashyBang in my electron project. Writing the code with React and compile and bundle it with webpack. This issue occurs when I minify the entire code for production. No error if I bundling without minifying.
Here is the console error message.
Failed to open Database: TypeError: given schema is no Schema-object
at Object.$.a (RxCollection.js:609)
at he.collection (RxDatabase.js:228)
@matsuo-ts Can you debug into it and check what constructor.name
is given here ?
A workarround is to enable keep_fnames
in your uglifyJS-config.
Webpack-example:
new webpack.optimize.UglifyJsPlugin({
beautify: false,
mangle: {
screw_ie8: true,
keep_fnames: true // <-- set this to true for quickfix
}, //prod
compress: { //prod
screw_ie8: true,
warnings: false
},
comments: false //prod
})
This is now fixed. Thx @muneebs The changed files will be published to npm with version 4.0.0. (next week)
If you need a fixed module faster, use this commit-hash into your package.json like this:
rxdb: "git://github.com/pubkey/rxdb.git#ac079880872b8c8b90db6602c20c5c740374706f"
@pubkey Sorry for late reply and thank you for your advise.
This
A workarround is to enable keep_fnames in your uglifyJS-config. Webpack-example:
new webpack.optimize.UglifyJsPlugin({ beautify: false, mangle: { screw_ie8: true, keep_fnames: true // <-- set this to true for quickfix }, //prod compress: { //prod screw_ie8: true, warnings: false }, comments: false //prod })
works fine on version 3.0.8
but after update to 4.0.0
I encountered another error.
Let me report that on the new issue.
Case
Bug.
Issue
I am getting the following error when using RxDB with electron, HOWEVER this is only happen when I build the app not when I run it in dev mode.
Info
Code