nuxt-typescript icon indicating copy to clipboard operation
nuxt-typescript copied to clipboard

Nuxt 2 Support

Open MPThLee opened this issue 7 years ago • 14 comments

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

MPThLee avatar May 28 '18 09:05 MPThLee

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

wagerfield avatar May 28 '18 09:05 wagerfield

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

wagerfield avatar May 28 '18 09:05 wagerfield

Thank you!

MPThLee avatar May 28 '18 10:05 MPThLee

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

wagerfield avatar May 28 '18 11:05 wagerfield

After some investigation, this error is actually because nuxt-edge is using Webpack 4 and with that, you need to use [email protected]. The vue-loader loaders are no longer used in nuxt-edge, so I will revert these changes for [email protected] 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.

wagerfield avatar May 28 '18 11:05 wagerfield

I trying to test it myself. it seems it works without set loaders in vue-loader with [email protected]. It looks like loaders option is deprecated.

ps. It works when i set "ts-loader": "^4.3.0" in package.json during use [email protected].

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

MPThLee avatar May 28 '18 14:05 MPThLee

@wagerfield 2.0 released!

0pt1m1z3r avatar Sep 21 '18 18:09 0pt1m1z3r

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)

hartmut-co-uk avatar Sep 23 '18 15:09 hartmut-co-uk

@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.

wagerfield avatar Sep 24 '18 09:09 wagerfield

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

benmccallum avatar Oct 06 '18 09:10 benmccallum

@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.

NickBolles avatar Oct 20 '18 19:10 NickBolles

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 👍

benmccallum avatar Dec 21 '18 12:12 benmccallum

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

  • there's support via create-nuxt-app coming straight after that as well. Shouldn't be too much longer :-)

hartmut-co-uk avatar Dec 21 '18 15:12 hartmut-co-uk

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 🎉

wagerfield avatar Dec 21 '18 15:12 wagerfield