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 read property 'browserField' of undefined #18

Open
kruncher opened this issue Jul 13, 2021 · 3 comments
Open

TypeError: Cannot read property 'browserField' of undefined #18

kruncher opened this issue Jul 13, 2021 · 3 comments

Comments

@kruncher
Copy link

I have the following in my gulpfile.js:

    return browserify(entryPoint, { debug: isDevelopment })
      .transform('esmify')

Which leads to the following error:

TypeError: Cannot read property 'browserField' of undefined
at module.exports (C:\Users\leaha\Desktop\git\design-system\node_modules\esmify\esmify.js:20:24)
at nr (C:\Users\leaha\Desktop\git\design-system\node_modules\module-deps\index.js:315:23)
at onfile (C:\Users\leaha\Desktop\git\design-system\node_modules\resolve\lib\async.js:146:21)
at onex (C:\Users\leaha\Desktop\git\design-system\node_modules\resolve\lib\async.js:201:32)
at C:\Users\leaha\Desktop\git\design-system\node_modules\resolve\lib\async.js:13:20
at FSReqCallback.oncomplete (fs.js:193:5)
at FSReqCallback.callbackTrampoline (internal/async_hooks.js:131:17)

@lejeunerenard
Copy link

I had this issue as well and figured out that I was using a really old version of browserify installed globally (4.1.9 👴). Once I updated to 17.0.0 it worked. From my investigation of the browserify source, this error should go away starting with 5.0.0 though I recommend upgrading to the latest.

@jcubic
Copy link

jcubic commented Jan 3, 2025

Go the same error with latest browserify 17.0.1 and latest esmify. I use command line:

npx browserify index.js -o bundle.js -t esmify --standalone ZenFS

@tjconcept
Copy link

@jcubic , did you by chance you --global-transform / -g rather than --plugin / -p?

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

4 participants