Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

updating from 0.4.1 to 0.4.2 causes app to error on startup #299

Open
barbalex opened this issue Sep 16, 2018 · 4 comments
Open

updating from 0.4.1 to 0.4.2 causes app to error on startup #299

barbalex opened this issue Sep 16, 2018 · 4 comments

Comments

@barbalex
Copy link
Contributor

This is the error:

Uncaught ReferenceError: require is not defined
    at Object../node_modules/graphql/jsutils/instanceOf.mjs (instanceOf.mjs:31)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/graphql/type/definition.mjs (definition.mjs:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/graphql/type/validate.mjs (validate.mjs:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/graphql/graphql.mjs (graphql.mjs:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/graphql/index.mjs (index.mjs:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/apollo-link-state/lib/utils.js (utils.js:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../node_modules/apollo-link-state/lib/index.js (index.js:1)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../src/client.js (index.css:9)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object../src/index.js (index.css?42ca:45)
    at __webpack_require__ (bootstrap:772)
    at fn (bootstrap:141)
    at Object.0 (theme.js:20)
    at __webpack_require__ (bootstrap:772)
    at checkDeferredModules (bootstrap:43)
    at Array.webpackJsonpCallback [as push] (bootstrap:30)
    at main.chunk.js:1

This is my package.json file before updating to v0.4.2: https://github.com/barbalex/apf2/blob/4848dc638c5849e6d50282647fb74fd2f165c4d8/package.json

I am using yarn's resolutions feature to prevent problems that occured due to different versions of graphql required in different apollo tools. Maybe enforcing graphql v0.13.2 is causing this?

@barbalex
Copy link
Contributor Author

barbalex commented Sep 16, 2018

I removed the graphql "resolutions" setting and tried:

  • not installing graphql: did not work. Same error as before
  • installing graphql v14.0.2: works

When I did not install graphql myself, the installed version was 0.13.2.

Is it possible that some new feature of apollo-link-state depends on graphql > 0.13.2 being installed?

This would be a bit risky seeing that apollo-client only installs v0.13.2 now: https://github.com/apollographql/apollo-client/blob/feb6617466fd144ca063133351e880590673f5ce/package.json#L108

@jsteenkamp
Copy link

jsteenkamp commented Sep 20, 2018

I'm seeing the same error. Updating GraphQL as you show worked.

@mlwilkerson
Copy link

Same error here too. Same solution worked.

@evilosa
Copy link

evilosa commented Nov 8, 2018

You can use temp solution with a latest graphql. Add resolutions to package.json
"resolutions": { "**/apollo-link-state": "0.4.1" },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants