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

getmac fails on electron as electron doesn't support editions #46

Closed
zouysay opened this issue May 5, 2019 · 7 comments
Closed

getmac fails on electron as electron doesn't support editions #46

zouysay opened this issue May 5, 2019 · 7 comments

Comments

@zouysay
Copy link

zouysay commented May 5, 2019

when i build electron , it occurs a warning:
WARNING in ./~/extract-opts/index.js
3:63-70 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

The code is :

const getmac = require('getmac')

module.exports = function () {
getmac.getMac((err, macAddress) => {
if (err) console.log(err)
console.log(macAddress, '>>>>>>>>>>>>>')
global.statisticInfo = {
...global.statisticInfo,
macAddress: macAddress || 'none'
}
})
}

but when i run electron locally, it works well.

what's the problem???

@balupton
Copy link
Member

balupton commented May 5, 2019

Which bundler are you using?

@zouysay
Copy link
Author

zouysay commented May 5, 2019

The latest npm package: 1.4.6

@zoneccc
Copy link

zoneccc commented May 6, 2019

I have the same problem

@biaoG
Copy link

biaoG commented May 7, 2019

me too,have you solved it?

@balupton
Copy link
Member

balupton commented May 7, 2019

Does electron now use webpack?

#43

@balupton
Copy link
Member

balupton commented May 8, 2019

To be clear, the issue is not ours. The issue is with whatever bundler is being used. The bundler must add support for the editions format. Details here: bevry/editions#24

@balupton balupton closed this as completed May 8, 2019
@balupton balupton changed the title The fails on electron/ Critical dependency getmac fails on electron as electron doesn't support editions May 8, 2019
@duoluodexiaoxiaoyuan
Copy link

I have the same problem我有同样的问题

I would like to ask if this problem has been solved?

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

5 participants