-
Notifications
You must be signed in to change notification settings - Fork 96
import {$,on} from "Sciter" fails. #12
Comments
Note: I'm sharing this as I it may help fixing internal implementation. I can confirm about receiving this error followed by:
Not sure what's causing this, but I discovered that the current implementation reports some errors when using // main.js
import mod from './mod.js' // OK
import { a } from './mod.js' // OK
import * as all from './mod.js' // OK but fails if the bundler converted it and used Object.freeze(__proto__:null...
// mod.js
export default 'module_default'
export const a = 'a-value'
export const b = 'b-value' // After transformation by the bundler
var mod = 'module_default';
const a = 'a-value';
const b = 'b-value';
var mod_all = /*#__PURE__*/Object.freeze({
__proto__: null,
'default': mod,
a: a,
b: b
}); Reported error after running the code generated by the bundler:
using @rollup/plugin-replace could fix this
// rollup.config.js
....
....
replace({
delimiters: ['', ''],
"__proto__: null,": ""
}) |
Thanks, fixed by 294b71d I've changed names of internal modules:
So names of all internal modules start from |
Not sure why such transformation is required. Also this works just fine: const a = 'a-value';
const b = 'b-value';
var mod_all = /*#__PURE__*/Object.freeze({
__proto__: null,
a: a,
b: b
});
console.log(mod_all.a,mod_all.b); |
svelte use a bundler like rollup to build the project and some transformations are applied:
I can confirm that the code above runs without issues, but the Likely, something else is getting affected by |
proto is deprecated and please check: rollup/rollup#3140 |
Please see #13 (console.log fails with const object = { proto: null }) |
@4silvertooth |
In usciter application that links SQLite statically and sets SQLite as a global namespace object: https://github.com/c-smile/sciter-js-sdk/blob/main/demos/usciter/usciter.cpp#L57 Sciter will have function |
I can see the reason now. |
Somewhat late now, but set |
Thanks for the share. Actually, We didn't had problems with freeze but with Anyway, thanks for https://github.com/intrnl/vite-plugin-svelte |
Check the sqlite db sample, it fails to load with this error.
warning:DOM: failed to load "/sciter-js-sdk/samples/sqlite/Sciter" file, error=2
The text was updated successfully, but these errors were encountered: