wagerfield / nuxt-typescript

TypeScript module for Nuxt
MIT License
90 stars 11 forks source link

Nuxt 2 Support #3

Open MPThLee opened 6 years ago

MPThLee commented 6 years ago

In vue-loader, (Currently) loaders is undefined in Nuxt v2. So it shows error like × error TypeError: Cannot set property 'ts' of undefined

This is my solution image

wagerfield commented 6 years ago

Thanks for the issue @MPThLee—I haven't used Nuxt v2 yet, but will add this fix now.

wagerfield commented 6 years ago

This is now fixed and published to NPM on v0.8.2. Thanks again @MPThLee 🎉

MPThLee commented 6 years ago

Thank you!

wagerfield commented 6 years ago

...actually after testing this, it doesn't seem to work for me, so will reopen and investigate now.

wagerfield commented 6 years ago

After some investigation, this error is actually because nuxt-edge is using Webpack 4 and with that, you need to use ts-loader@4.x. The vue-loader loaders are no longer used in nuxt-edge, so I will revert these changes for nuxt@1.x and publish on NPM with version 1.x and then create another major version for Nuxt 2 under 2.x.

Will let you know when this is done.

MPThLee commented 6 years ago

I trying to test it myself. it seems it works without set loaders in vue-loader with ts-loader@4.3. It looks like loaders option is deprecated.

ps. It works when i set "ts-loader": "^4.3.0" in package.json during use nuxt-typescript@0.8.2.

Edit: Ok, I found it from nuxt/nuxt.js@3efbd1b54529420c815d957771bff46305e16307 (nuxt/nuxt.js#3093)

0pt1m1z3r commented 5 years ago

@wagerfield 2.0 released!

hartmut-co-uk commented 5 years ago

I've got a project currently on nuxt-edge with TS and my custom setup - planning to move to your module along with the nuxt 2 upgrade - so would be happy to help testing and verifying if required... (will be away for 3 weeks though)

wagerfield commented 5 years ago

@MPThLee @0pt1m1z3r @hartmut-co-uk I will work on support for Nuxt 2.0 over the coming days and let you know when I have published an update.

benmccallum commented 5 years ago

Also keen for this, do let us know how you go!

NickBolles commented 5 years ago

@wagerfield How is this coming? If you haven't gotten time to work on it I can take a look and see what I can do.

benmccallum commented 5 years ago

Latest news there's a PR being merged into Nuxt core that will make this all possible with a config bool flag. So potentially we'll get that soon 👍

hartmut-co-uk commented 5 years ago

Hi, correct - there's been 2 PRs merged into nuxt-edge already - one more to go.

wagerfield commented 5 years ago

Apologies everyone, I've been very busy as of late so haven't had a chance to keep on top of this.

Very excited to hear that there's an official effort from the core team underway 🎉