Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot assign to read only property '__esModule' of object '#<Object>' #35

Closed
zomars opened this issue Sep 28, 2019 · 4 comments · Fixed by #36
Closed

TypeError: Cannot assign to read only property '__esModule' of object '#<Object>' #35

zomars opened this issue Sep 28, 2019 · 4 comments · Fixed by #36

Comments

@zomars
Copy link
Contributor

zomars commented Sep 28, 2019

On a freshly cloned copy, I've ran npm install then npm run dev and I'm getting this error:

TypeError: Cannot assign to read only property '__esModule' of object '#<Object>'
    at OMMITED/next-shopify-storefront/node_modules/apollo-boost/lib/bundle.cjs.js:127:74
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (OMMITED/next-shopify-storefront/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.apollo-boost (OMMITED/next-shopify-storefront/.next/server/static/development/pages/webpack:/external "apollo-boost":1:1)
    at __webpack_require__ (OMMITED/next-shopify-storefront/.next/server/static/development/pages/webpack:/webpack/bootstrap:21:1)
    at Module../services/checkout.service.ts (OMMITED/next-shopify-storefront/.next/server/static/development/pages/_app.js:2455:70)
    at __webpack_require__ (OMMITED/next-shopify-storefront/.next/server/static/development/pages/webpack:/webpack/bootstrap:21:1)
    at Module../services/index.ts (OMMITED/next-shopify-storefront/.next/server/static/development/pages/webpack:/services/index.ts:1:1)
    at __webpack_require__ (OMMITED/next-shopify-storefront/.next/server/static/development/pages/webpack:/webpack/bootstrap:21:1)
@maithanhnhan
Copy link

maithanhnhan commented Sep 29, 2019

This sounds a lot like #4843. Try upgrading apollo-boost to 0.4.4 and see if that fixes it

@zomars
Copy link
Contributor Author

zomars commented Sep 30, 2019

Thanks for the advice @maithanhnhan 🙏 . I've ran yarn upgrade-interactive --latest and upgraded all dependencies to their latest version. Also made some required upgrades, since latest next js version has TypeScript support. All good so far, but now I'm getting syntax errors:


[ error ] ./pages/_app.tsx
SyntaxError: /Users/zomars/Sites/next-shopify-storefront/pages/_app.tsx: Unexpected token (8:9)

   6 |
   7 | class MyApp extends App {
>  8 |   public static async getInitialProps({ Component, ctx }) {
     |          ^
   9 |     const { req, res, store } = ctx;
  10 |     const pageProps = Component.getInitialProps ? await Component.getInitialProps(ctx) : {};
  11 |

@zomars
Copy link
Contributor Author

zomars commented Sep 30, 2019

Nevermind. I've reverted all my changes and just upgraded apollo-boost and it's working now. I'll make a PR with this change. Thanks!

zomars added a commit to zomars/next-shopify-storefront that referenced this issue Sep 30, 2019
@VienDinhCom
Copy link
Owner

Thank you @zomars! I have just merged your PR.

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

Successfully merging a pull request may close this issue.

3 participants