question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

[BUG] Typescript: Maximum call stack size exceeded

See original GitHub issue

Describe the bug

Everytime i will run the npx @shopware-pwa/cli@latest i will get an error that the Maximum call stack size exceeded.

Versions

PWA Version: 0.9.0 Shopware version: 6.4

tsconfig.json

{
  "compilerOptions": {
    "target": "ES2018",
    "module": "ESNext",
    "moduleResolution": "Node",
    "lib": ["ESNext", "ESNext.AsyncIterable", "DOM"],
    "esModuleInterop": true,
    "allowJs": true,
    "sourceMap": true,
    "strict": true,
    "noEmit": true,
    "baseUrl": ".",
    "paths": {
      "~/*": ["./*"],
      "@/*": ["./.shopware-pwa/source/*"]
    },
    "types": ["@types/node", "@nuxt/types"]
  },
  "exclude": ["node_modules"]
}

Stack trace

 ERROR  RangeError: Maximum call stack size exceeded                                                                                11:14:48

  at Object.getCheckFlags (node_modules/typescript/lib/typescript.js:18470:27)
  at addPropertyToElementList (node_modules/typescript/lib/typescript.js:48397:53)
  at createTypeNodesFromResolvedType (node_modules/typescript/lib/typescript.js:48384:25)
  at createTypeNodeFromObjectType (node_modules/typescript/lib/typescript.js:48190:35)
  at visitAndTransformType (node_modules/typescript/lib/typescript.js:48138:34)
  at createAnonymousTypeNode (node_modules/typescript/lib/typescript.js:48092:36)
  at typeToTypeNodeHelper (node_modules/typescript/lib/typescript.js:47989:28)
  at serializeReturnTypeForSignature (node_modules/typescript/lib/typescript.js:49181:24)
  at signatureToSignatureDeclarationHelper (node_modules/typescript/lib/typescript.js:48586:42)
  at addPropertyToElementList (node_modules/typescript/lib/typescript.js:48424:49)

Extra information

This error occurred after the update from 0.8.2 to 0.9.0 i donโ€™t use any typescript in my code yet.

Steps

  1. npx @shopware-pwa/cli@0.9.0 dev
  2. is see the following response
 Using theme: @shopware-pwa/default-theme                                                                                          11:14:37

   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                            โ”‚
   โ”‚   Nuxt @ v2.15.6                           โ”‚
   โ”‚                                            โ”‚
   โ”‚   โ–ธ Environment: development               โ”‚
   โ”‚   โ–ธ Rendering:   server-side               โ”‚
   โ”‚   โ–ธ Target:      server                    โ”‚
   โ”‚                                            โ”‚
   โ”‚   Listening: http://0.0.0.0:3000/   โ”‚
   โ”‚                                            โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ„น Preparing project for development                                                                                                 11:14:38
โ„น Initial build may take a while                                                                                                    11:14:38
โ„น Discovered Components: .nuxt/components/readme.md                                                                                 11:14:38
โœ” Builder initialized                                                                                                               11:14:38
โœ” Nuxt files generated   


โœ” Client
  Compiled successfully in 31.11s

โœ” Server
  Compiled successfully in 27.78s


 ERROR  RangeError: Maximum call stack size exceeded                                                                                11:14:48

  at Object.getCheckFlags (node_modules/typescript/lib/typescript.js:18470:27)
  at addPropertyToElementList (node_modules/typescript/lib/typescript.js:48397:53)
  at createTypeNodesFromResolvedType (node_modules/typescript/lib/typescript.js:48384:25)
  at createTypeNodeFromObjectType (node_modules/typescript/lib/typescript.js:48190:35)
  at visitAndTransformType (node_modules/typescript/lib/typescript.js:48138:34)
  at createAnonymousTypeNode (node_modules/typescript/lib/typescript.js:48092:36)
  at typeToTypeNodeHelper (node_modules/typescript/lib/typescript.js:47989:28)
  at serializeReturnTypeForSignature (node_modules/typescript/lib/typescript.js:49181:24)
  at signatureToSignatureDeclarationHelper (node_modules/typescript/lib/typescript.js:48586:42)
  at addPropertyToElementList (node_modules/typescript/lib/typescript.js:48424:49)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
meeshoogendoorncommented, Jun 8, 2021

@mkucmus The problem was in the SfTable component from storefront-ui.

provide() {
    const table = {};
    Object.defineProperty(table, "updateColumnsCount", {
      value: this.updateColumnsCount,
    });
    return { table };
  },

This code above was returning in an exception Object.defineProperty called on non-object but in the typescript compiler it was not throwing this message. I will throw in issue in their repo.

1reaction
patzickcommented, Jun 8, 2021

thanks for bringing it up; looks like the problem with dependencies, please try the following steps:

  1. update the version in package.json
  2. yarn upgrade
  3. yarn shopware-pwa init
  4. yarn dev (do not use npx for anything else than init)

what else could help if not this:

  • remove node_modules directory and yarn.lock file
  • (DO BACKUP BEFORE) remove nuxt.config.js and invoke npx @shopware-pwa/cli init

if nothing from above works please show us your package.json and yarn.lock file

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to overcome maximum call stack size exceeded in ...
I've implemented snapshot, implemented error handling, my promises aren't nested. Yet the error continues HELP!! get _assessmentData():ย ...
Read more >
Maximum Call Stack Size Exceeded (Typescript Error) - Medium
Most browsers will execute functions inside functions until their default call stack limit is exceeded.
Read more >
RangeError: Maximum call stack size exceeded #50348
I've confirmed the code crashes tsc on the latest nightly version, and works on 4.5.5 . It appears to be caused by importing...
Read more >
Maximum call stack size exceeded Error in TypeScript
The "RangeError: Maximum call stack size exceeded" occurs when a function is being called so many times that the invocations exceed the call...
Read more >
Deal With โ€œMaximum Call Stack Size Exceededโ€ in JavaScript
Dealing with the โ€œMaximum call stack size exceededโ€ error is easy. All you have to do is avoid using the spread operator or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found