Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Production error: TypeError: Xu is not a constructor on latest sveltekit #77

Open
bridge-jithesh opened this issue Jan 20, 2022 · 2 comments

Comments

@bridge-jithesh
Copy link

bridge-jithesh commented Jan 20, 2022

Hi, I am having a production error in the bundle. browser console says:

Uncaught (in promise) TypeError: Xu is not a constructor
    at vendor-ee02d4c9.js:15:24290
    at Ze (vendor-ee02d4c9.js:1:845)
    at Array.map (<anonymous>)
    at vendor-ee02d4c9.js:4:6191
    at pn (vendor-ee02d4c9.js:4:2492)
    at _e (vendor-ee02d4c9.js:4:7249)
    at new Te (start-b5777f44.js:1:6066)
    at We._init (start-b5777f44.js:1:19629)
    at We.start (start-b5777f44.js:1:17982)
    at async Me (start-b5777f44.js:1:24208)

Any idea what it could be?

I am using Sveltekit ^1.0.0-next.221, Svelte ^3.44.1

Very basic setup as in the demo. Works fine on npm run dev. No, build errors either.
You can reproduce it by running npm run build and npm run preview
Any idea what is the issue?

@bridge-jithesh bridge-jithesh changed the title Production error on latest sveltekit Production error: TypeError: Xu is not a constructor on latest sveltekit Jan 20, 2022
@CraigChamberlain
Copy link

CraigChamberlain commented Jan 25, 2022

Getting nearly the same in production:

Uncaught (in promise) TypeError: ze is not a constructor
Ae Carousel.svelte:109
t index.mjs:18
_n index.mjs:1802
mn index.mjs:1067
t index.mjs:1405
wn index.mjs:1412

However, I was getting this in dev which makes more sense without the minification:
Uncaught (in promise) TypeError: Siema is not a constructor
D Carousel.svelte:110
run index.mjs:18
mount_component index.mjs:1802
flush index.mjs:1067
update index.mjs:1405
handle_promise index.mjs:1412
promise callback*handle_promise index.mjs:1410
create_fragment$z bundle.js:7006
init$1 index.mjs:1877
Carousel_1 bundle.js:7107
create_fragment$y bundle.js:7127
init$1 index.mjs:1877
Home bundle.js:7204
create_if_block_1$4 bundle.js:2131
create_if_block$8 bundle.js:1973
update bundle.js:2238
update index.mjs:1085
flush index.mjs:1052
init$1 index.mjs:1894
App bundle.js:21947
app main.js:3
bundle.js:21973
Carousel.svelte:110:12

I'm not using Svelte Kit, just svelte.

ncaught (in promise) TypeError: Siema is not a constructor
D Carousel.svelte:110
run index.mjs:18
mount_component index.mjs:1802
flush index.mjs:1067
update index.mjs:1405
handle_promise index.mjs:1412
promise callback*handle_promise index.mjs:1410
create_fragment$z bundle.js:7006
init$1 index.mjs:1877
Carousel_1 bundle.js:7107
create_fragment$y bundle.js:7127
init$1 index.mjs:1877
Home bundle.js:7204
create_if_block_1$4 bundle.js:2131
create_if_block$8 bundle.js:1973
update bundle.js:2238
update index.mjs:1085
flush index.mjs:1052
init$1 index.mjs:1894
App bundle.js:21947
app main.js:3
bundle.js:21973
Carousel.svelte:110:12

​Looks like this:

image

Should be:

image

@CraigChamberlain
Copy link

I just found that leaving Svelte-Carousel at 2.8.0 fixed the problem and can update other deps:

"@beyonk/svelte-carousel": "~2.8.0"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants