adamsoffer / next-apollo

React higher-order component for integrating Apollo Client with Next.js
MIT License
482 stars 64 forks source link

TypeError: Cannot assign to read only property '__esModule' of object '#<Object>' thrown by apollo-boost dependency #39

Closed erikvilla closed 5 years ago

erikvilla commented 5 years ago

Steps to reproduce:

npm install --save next-apollo graphql react-apollo

Wrap any sample page with withData HOC export default withData(Index);

The following error es thrown:

TypeError: Cannot assign to read only property '__esModule' of object '#<Object>'
    at /Users/erikvilla/git/gsw-suites-exchange/frontend/node_modules/apollo-boost/lib/bundle.cjs.js:127:74
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/erikvilla/git/gsw-suites-exchange/frontend/node_modules/apollo-boost/lib/bundle.cjs.js:127:36)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/erikvilla/git/gsw-suites-exchange/frontend/node_modules/next-apollo/dist/initApollo.js:12:20)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

Updating the apollo-boostversion to0.4.2` using shrinkwrap solves the issue

erikvilla commented 5 years ago

I just read comments in: https://github.com/adamsoffer/next-apollo/pull/38, 0.4.2 seems to work fine now.