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.

Cannot read property 'custom' of undefined

See original GitHub issue

⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.

Describe the bug

The development environment is fine, but the production environment reports an error And I used umi-request TypeError: Cannot read property 'custom' of undefined at index.2642e881.js:1

Reproduction

a minimal GitHub repository: https://github.com/rashagu/vite_test1

System Info

  • vite version:2.1.2
  • Operating System:win10
  • Node version:14
  • Package manager (npm/yarn/pnpm) and version:yarn 1.22.10

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
ds300commented, Mar 22, 2021

I fixed this by replacing my usage of qs with querystring, since qs has a transitive dependency on object-inspect. Thanks for the tip @matias-capeletto 👍🏼

5reactions
patak-devcommented, Mar 30, 2021

If absolutely necessary, I’m willing to update the package to bypass the issue, but before doing that, I’d prefer to hear from a vite maintainer as to either when the proper fix will be deployed, or why it’s difficult to do the proper fix.

@ljharb Vite v2.1.4 has been released with improved support for browser field resolution. There is no need to patch object-inspect, I just tested and it now works as expected. Thanks for your input on this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
Getting 'Cannot read property 'ɵmod' of undefined' when ...
I'm trying to make a custom module ...
Read more >
ERROR TypeError: Cannot read property &#38 - MDBootstrap
I am using charts. I have this error when I filter by dates. ERROR TypeError: Cannot read property 'custom' of undefined at i....
Read more >
Cannot read properties of undefined (reading 'length') - TrackJS
This error can be thrown for a lot of reasons, as it is incredibly common to reference the length property of string 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