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

ReferenceError: require is not defined #239

Closed
amiiigh opened this issue Jan 15, 2025 · 5 comments
Closed

ReferenceError: require is not defined #239

amiiigh opened this issue Jan 15, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@amiiigh
Copy link

amiiigh commented Jan 15, 2025

Describe the bug

Hi
I am getting this error when using the version 3.7.0
ReferenceError: require is not defined
at ./node_modules/unleash-proxy-client/build/main.esm.js (main.esm.js:1:4855)
I cant repro with 3.6.1

In the latest version of unleash-proxy-client, we encountered a "require is not defined" error when bundling with Webpack 5 in a browser environment. This seems to be caused by CommonJS require statements in the distributed ESM build (main.esm.js), which is unexpected in an ES module. Webpack 5 does not provide automatic polyfills for Node.js built-ins, which may be causing this issue. Prior versions of unleash-proxy-client did not exhibit this behavior, and similar imports worked correctly in our setup. Could you confirm if this change was intentional, and if so, recommend the best way to use this package in a Webpack 5 project without modifying polyfill settings?

Steps to reproduce the bug

No response

Expected behavior

No response

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

@amiiigh amiiigh added the bug Something isn't working label Jan 15, 2025
@finch001
Copy link

Hi, I have encountered the same issue as well. My approach to resolving it was to first downgrade the version.

@araera111
Copy link

image
I'm encountering an error when trying to reference the "package.json" file in my browser.
#235

@FredrikOseberg FredrikOseberg moved this from New to Investigating in Issues and PRs Jan 16, 2025
@kwasniew
Copy link
Contributor

Thanks for the report!
This PR we merged today should have fixed it. #237
Please let us know if version 3.7.1 works fine for you.

@thomasheartman
Copy link
Contributor

I'm closing this because it seems to have been resolved. Please reopen if it isn't.

@github-project-automation github-project-automation bot moved this from Investigating to Done in Issues and PRs Jan 16, 2025
@amiiigh
Copy link
Author

amiiigh commented Jan 16, 2025

Thank you
the issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants