Has anybody tried svelte mobile?


Windows 10
Meteor 1.10.2
Svelte 3.23.2
Emulator: Pixel 3a (Android v9 API 28)
Mobile Device: Pixel 4 (Android v10 API 29)

So I am doing the tutorial for svelte and everything was going well. But for the sixth step “Running on mobile”, I was struggling to get the thing working on mobile. The app is just meteor with svelte. The app runs but it show a white empty screen after the splash screen. I made sure that the mobile server is accessible through both a mobile device and the emulator. I tried it in the browser and it works as expected only if I toggle “Request Desktop Site” (otherwise the browser also shows a blank page). In the console logs, I get the following error:

I20200620-16:24:03.559(3)? 06-20 16:23:10.785   774   774 I chromium: [INFO:CONSOLE(493)] "Uncaught TypeError: Class constructor SvelteComponentDev cannot be invoked without 'new'", source: http://localhost:12224/
__cordova/app/app.js?hash=834c8bccf6c9f65e259b13d121189e2ff9dc0765 (493)

The docs do say that a specific command is not available on windows but I got it working nevertheless. I’ll try running the thing using a mac vm but idk has anybody got svelte meteor working on mobile?

so nobody has used meteor with svelte?

I have the same issue with svelte

any answers?

@brianmulhall might have tried this as he has been working on Meteor tutorials :+1:

Just tried on iOS with the simple-todos-svelte repo. I’m seeing two issues:

  1. In the Xcode console: Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service. Not sure if this is svelte related. I left a comment on this issue: https://github.com/meteor/cordova-plugin-meteor-webapp/issues/34.

  2. In the Safari console, I see the same error that you’re seeing: TypeError: Cannot call a class constructor without |new|

@brianmulhall @rdb since y’all have some more experience with svelte, have you been able to get it running with Cordova?

someone figured the issue?

Haven’t quite solved it yet but I think it may have to do with babel.

@arggh I came across this svelte issue you created https://github.com/sveltejs/svelte/issues/3388. Wondering if you had any insight on how to resolve the error we’re seeing:

TypeError: Cannot call a class constructor without |new|

Ok, I got it working. You need to create a symbolic link to node_modules/svelte:

// navigate to your app's root directory, then go to imports, and then create the symbolic link there
$ cd imports
$ ln -s ../node_modules/svelte/

Note: using nodeModules recompile option in package.json did not work for me. I had to create a symbolic link.

This feels like a temporary workaround. If anyone is aware of a better solve, I’d love to hear it. @benjamn @coagmano @filipenevola

Thanks a lot. I’ll try it out soon and double check