Apollo-module: "Uncaught ReferenceError: require is not defined" when using nuxt-edge

Created on 15 Sep 2018  路  6Comments  路  Source: nuxt-community/apollo-module

Version

v4.0.0-rc.2

Reproduction link

https://github.com/Vlaoff/apollonuxt

Steps to reproduce

I get the error when I launch nuxt and open it in the browser

What is expected ?

Babel should transpile the require

What is actually happening?

Babel keeps the require

Additional comments?

I think it's a problem with the babel 7/wepack 4 configuration.

It does not occur on nuxt 1.4.2, only on the nuxt-edge 2.0.0-xxx

I don't know if the problem is from @nuxtjs/apollo or nuxt.

This bug report is available on Nuxt community (#c139)
bug-report

Most helpful comment

should be fixed with rc3

All 6 comments

Same error here, but, as explained in referenced issue, npm i graphql to put version 14.0.2 seems to be a working work around.

@Vlaoff That should be fixed, could you try? ( delete lock file and reinstall)

Still not fixed. Reproduced with Nuxt v.2.0.0 and apollo v4.0.0-rc.2

Now its only fixed for vue-cli-plugin-apollo 0.17 while here its set as 0.16
https://github.com/nuxt-community/apollo-module/blob/master/package.json#L31
So a bump of vue-cli-plugin-apollo required
@dohomi

And I think the same with graphql-tag, this uses graphql ^0.13.0, and upgrading to vue-cli-plugin-apollo uses graphql ^14.0.2.

So it looks like we need to wait for this one as well.

https://github.com/apollographql/graphql-tag/issues/208

UPDATE: This has now been updated to graphql ^14.0.2, you need to get graphql-tag ^2.1.0

should be fixed with rc3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmitryyankowski picture dmitryyankowski  路  9Comments

lindesvard picture lindesvard  路  7Comments

drewbaker picture drewbaker  路  6Comments

leviwheatcroft picture leviwheatcroft  路  5Comments

yaki4 picture yaki4  路  9Comments