Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

reactjs - import i18next from 'i18next' causes `Cannot assign to read only property 'exports' of object '#<Object>' `

In an electron app when inserting this line:

import i18next from 'i18next';

I get this error:

TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    at Module.<anonymous> (/home/marco/webMatters/electronMatters/IPFSbase/.webpack
/main/index.js:76805:16)
    at Module../src/ipfs-on-path/index.js (/home/marco/webMatters/electronMatters/IPFSbase
/.webpack/main/index.js:76906:30)

devDependencies:

"electron": "^11.2.1",
"typescript": "^4.0.2",

dependencies:

"i18next": "^19.8.4",
"i18next-electron-language-detector": "^0.0.10",
"i18next-icu": "^1.4.2",
"i18next-node-fs-backend": "^2.1.3",    
  • node version: v14.5.0
  • O.S. : Ubuntu 18.04.4.Desktop

How to solve the problem?

question from:https://stackoverflow.com/questions/65890190/import-i18next-from-i18next-causes-cannot-assign-to-read-only-property-expor

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...