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

[crx:content-script-resources] RangeError: Maximum call stack size exceeded #908

Open
1 of 2 tasks
rezasohrabi opened this issue Jul 29, 2024 · 2 comments
Open
1 of 2 tasks

Comments

@rezasohrabi
Copy link

rezasohrabi commented Jul 29, 2024

Build tool

Rollup

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

hi
i use jspdf and html2canvas-pro to generate pdf of current page, everythin in development is ok, but when i try build the extension this error occurs
how to fix this build error?

Reproduction

when i import and use jspdf in my extension this error occurs

import { jsPDF } from 'jspdf';
const pdf = new jsPDF('p', 'mm', 'a4');

Logs

│ [crx:content-script-resources] RangeError: Maximum call stack size exceeded
│     at SetIterator.next (<anonymous>)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3289:24)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│     at getResources (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/vite-plugi
│ n/dist/index.mjs:3292:19)
│ ✓ built in 21.06s
│ error during build:
│ Error: [crx:manifest-post] Error in crx:content-script-resources.renderCrxManifest
│     at Object.generateBundle (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/@[email protected][email protected]/node_modules/@crxjs/v
│ ite-plugin/dist/index.mjs
│ :2933:19)
│     at async Bundle.generate (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry
│ .js:17059:9)
│     at async file:///C:/Users/ACER/Desktop/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19605:27
│     at async catchUnfinishedHookActions (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared
│ /node-entry.js:19036:16) 
│     at async build (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/d
│ ep-94_H5fT6.js:66899:22) 
│     at async CAC.<anonymous> (file:///C:/Users/ACER/Desktop/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/nod
│ e/cli.js:842:9)
│  ELIFECYCLE  Command failed with exit code 1.

System Info

OS: Windows 10
CPU: (12) x64 Intel(R) Core(TM) i7-9750H 
Memory: 15.85 GB
pnpm: 8.15.0 
browser: chrome

Severity

annoyance

@cwc1222
Copy link

cwc1222 commented Jul 31, 2024

I had a similar issue, then solved the issue by increasing the version from

"@crxjs/vite-plugin": "^1.0.14",
"vite": "^2.9.15",

to

"@crxjs/vite-plugin": "^2.0.0-beta.25",
"vite": "^4.2.2"

@Toumash
Copy link

Toumash commented Aug 6, 2024

Yeah, works for me no problem

    "jspdf": "^2.5.1",
    "@crxjs/vite-plugin": "^2.0.0-beta.23",
    "vite": "^5.2.11",

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

No branches or pull requests

3 participants