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

Running 'npm run build' on my React JS app returned "Cannot read properties of undefined (reading 'thisArg')" #13183

Closed
7 tasks done
Albertyhu opened this issue May 12, 2023 · 2 comments

Comments

@Albertyhu
Copy link

Albertyhu commented May 12, 2023

Describe the bug

I built a React JS app on Vite and I am having issues trying to deploy it on Firebase. The dev mode works just find, but when I ran the command line "npm run build", I get the following error:

Cannot read properties of undefined (reading 'thisArg')
error during build:
TypeError: Cannot read properties of undefined (reading 'thisArg')
    at CallExpression.applyDeoptimizations (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:9537:30)
    at CallExpression.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:9503:22)
    at ExpressionStatement.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:5750:28)
    at Program.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:11487:22)
    at Program.hasCachedEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:11482:44)
    at Module.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13379:75)
    at addSideEffectDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13719:72)
    at Module.addRelevantSideEffectDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13726:9)
    at Module.getDependenciesToBeIncluded (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13237:18)
    at addStaticDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:14947:33)

Reproduction

https://github.com/Albertyhu/BlogClient

Steps to reproduce

Run 'npm run build'

System Info

OS: Microsoft Windows 11 Home

Node Version v18.13.0
vite/4.3.5 win32-x64

Used Package Manager

npm

Logs

Log:

Cannot read properties of undefined (reading 'thisArg')
error during build:
TypeError: Cannot read properties of undefined (reading 'thisArg')
    at CallExpression.applyDeoptimizations (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:9537:30)
    at CallExpression.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:9503:22)
    at ExpressionStatement.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:5750:28)
    at Program.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:11487:22)
    at Program.hasCachedEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:11482:44)
    at Module.hasEffects (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13379:75)
    at addSideEffectDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13719:72)
    at Module.addRelevantSideEffectDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13726:9)
    at Module.getDependenciesToBeIncluded (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:13237:18)
    at addStaticDependencies (file:///D:/NodeJS%20projects/BlogApiSite/BlogClientSite/node_modules/rollup/dist/es/shared/node-entry.js:14947:33)

Validations

@sapphi-red
Copy link
Member

sapphi-red commented May 13, 2023

There was a bug in Rollup 3.13.0 - 3.20.1 (rollup/rollup#4908).
You are using 3.18.0.
https://github.com/Albertyhu/BlogClient/blob/a7137cd26f54be47aa0f698763350d16babed8ab/package-lock.json#L3011-L3026

I'll close this issue for now as I guess it would work if you update rollup version.
If doesn't work, please create a new issue with a minimal reproduction.

@Albertyhu
Copy link
Author

@sapphi-red Thanks for pointing that out.

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2023
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

2 participants