zodern / melte

Svelte compiler for Meteor with built in tracker integration and HMR
MIT License
33 stars 14 forks source link

Svelte + TypeScript: this.getTs( ... ) is not a function #15

Closed dayemeeter closed 2 years ago

dayemeeter commented 2 years ago

When I follow the instructions to set up typsecript, I receive the following output:

 !  ~/c/w/d/app   *~+…  meteor                    2.8m  Fri 10 Dec 2021 05:01:16 PM CET
[[[[[ ~/code/web/daymeter/app ]]]]]

=> Started proxy.
=> Started HMR server.
=> Errors prevented startup:

   While building for web.browser:
   imports/ui/App.svelte: Cannot find module 'typescript'
   Require stack:
   -
   /home/kevin/.meteor/packages/zodern_melte/.1.4.4.11x2b6e.30lh++os+web.browser+web.browser.legacy+web.cordova/plugin.melte-compiler.os/npm/node_modules/meteor/zodern_melte-compiler/node_modules/svelte-preprocess/dist/transformers/typescript.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/isobuild/bundler.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/isobuild/compiler.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/package-client.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/catalog/catalog-remote.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/catalog/catalog.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/tropohouse.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/meteor-services/config.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/meteor-services/auth.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/utils/http-helpers.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/packaging/warehouse.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/cli/main.js
   -
   /home/kevin/.meteor/packages/meteor-tool/.2.5.1.1ru6508.wvws++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/index.js

   While building for web.browser.legacy:
   imports/ui/App.svelte: this.getTs(...) is not a function

=> Your application has errors. Waiting for file change.
=> Started MongoDB.

I did tell Meteor to recompile Svelte:

package.json

[...]
  "meteor": {
    "mainModule": {
      "client": "client/main.js",
      "server": "server/main.js"
    },
    "testModule": "tests/main.js",
    "nodeModules": {
      "recompile": {
        "svelte": "legacy"
      }
    }
  },
[...]

TypeScript is installed. I can see it in the node_modules directory.

What might I be missing in my configuration?

dayemeeter commented 2 years ago

Already fixed in zodern:melte@1.4.5-beta.2, as told to me on Slack by zodern.