Hi there,
I’m currently working on my first Sveltekit app on the IC. It’s pretty simple so far. The only code I run in onMount()
is a measurement of getBoundingClientRect()
. The problem is that the dimensions on the vertical axis (height and consequently y) turn out different when run locally vs when run on the IC. I cannot wrap my head around this, since my understanding is that the Sveltekit example from this repo generates static sites where all assets should already have been loaded when they are served to the client. So there shouldn’t be any timing issues when calling getBoundingClientRect()
on the local vs on the live version. I use the svelte.config.js as it is shown in the example repo:
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess({
postcss: {
plugins: [autoprefixer]
}
}),
kit: {
adapter: adapter({
fallback: 'index.html',
precompress: false
}),
files: {
assets: filesPath('static'),
hooks: {
client: filesPath('src/hooks.client'),
server: filesPath('src/hooks.server')
},
lib: filesPath('src/lib'),
params: filesPath('src/params'),
routes: filesPath('src/routes'),
serviceWorker: filesPath('src/service-worker'),
appTemplate: filesPath('src/app.html'),
errorTemplate: filesPath('src/error.html')
}
},
serviceWorker: {
register: false
},
version: {
name: version
},
trailingSlash: 'always'
};
export default config;
I wonder whether this is related to the IC in some way, or just a common frontend issue when using these kinds of apps that I’m not aware of?