SDK Version: 35
Platform: web
The app is running on Android and iOS, but if I try to compile my app for web, I get the error:
TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Module.<anonymous>
C:/repos/project/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js:112
109 | })
110 | }
111 |
> 112 | module.exports = AsyncStorageCore
113 |
View compiled
Module.../../../../../../../../../../../repos/project/node_modules/pouchdb-adapter-asyncstorage/src/asyncstorage_core.js
http://192.168.0.100:19006/static/js/bundle.js:74972:30
__webpack_require__
C:/repos/project/webpack/bootstrap:723
720 | };
721 |
722 | // Execute the module function
> 723 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 724 |
725 | // Flag the module as loaded
726 | module.l = true;
The app is written in TypeScript.
I use following babel.config.js
module.exports = function(api) {
api.cache(true);
return {
presets: [
[
'babel-preset-expo',
{
web: { disableImportExportTransform: true }
}
],
],
};
};
It makes no difference if the value of disableImportExportTransform is true or false, the error stays.
This is my tsconfig.json:
{
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-native",
"lib": [
"es6"
],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"target": "esnext",
"resolveJsonModule": true
},
"exclude": ["node_modules"],
"include": [
"src/types/interfaces.ts",
"App.tsx"
]
}