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

In the electronic application, when I start nodeintegration, the program appears default-encoding.js? 9f9d:10 Uncaught TypeError: Cannot read property 'split' of undefined #103

Open
hrm476 opened this issue Nov 15, 2021 · 1 comment

Comments

@hrm476
Copy link

hrm476 commented Nov 15, 2021

var defaultEncoding
/* istanbul ignore next */
if (global.process && global.process.browser) {
defaultEncoding = 'utf-8'
} else if (global.process && global.process.version) {
console.log('process.version', process.version) // undefined
console.log('global.process.version', global.process.version) // v12.18.3

// This line needs to be modified to "global.process.version"
// var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)

// like this
var pVersionMajor = parseInt(global.process.version.split('.')[0].slice(1), 10)

defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'

} else {
defaultEncoding = 'utf-8'
}
module.exports = defaultEncoding

@kuroky360
Copy link

downgraded to version 3.1.1 @hrm476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants