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.
- Read the docs.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
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)
- Run
vite
orvite build
with the--debug
flag. - Provide the error log here.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:25 (10 by maintainers)
Top 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 & - 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I fixed this by replacing my usage of
qs
withquerystring
, sinceqs
has a transitive dependency onobject-inspect
. Thanks for the tip @matias-capeletto 👍🏼@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.