leva icon indicating copy to clipboard operation
leva copied to clipboard

strange error on compiled code "type" no defined

Open dberardo-com opened this issue 2 years ago • 0 comments

i had this error only on compiled bundle.

when the script tag was injected in the browser i got this error:

Uncaught TypeError: Cannot read properties of undefined (reading 'type')

had to add this to the code to make it work:

// https://stackoverflow.com/questions/51716694/webpack-vuejs-how-to-import-a-module-only-in-dev-mode-and-ignore-it-in-producti

if(process.env.NODE_ENV === 'development') require("lerna");

dberardo-com avatar Feb 02 '23 14:02 dberardo-com