-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Error: Cannot assign to read only property 'exports' of object '#<Object>' #304
Comments
Yeah this seems like a tooling evolution. I'll check it out. Unfortunately it requires quite a bit of set up to verify this so it won't be super soon. If you are using the latest tools feel free to submit a PR. |
I am actually a newbie and trying figwheel for the first time. I have almost no background in Javascript.
So I am afraid I can't submit a PR.
… On 15/09/2021 18:49 Bruce Hauman ***@***.***> wrote:
Yeah this seems like a tooling evolution. I'll check it out.
Unfortunately it requires quite a bit of set up to verify this so it won't be super soon.
If you are using the latest tools feel free to submit a PR.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #304 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIFK3WQ5BFS4LRF2PRAFKLUCDFAZANCNFSM5ECH2KPQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
|
Did you follow these instructions?
If you are using Expo edit package.jsonand change "main": "node_modules/expo/AppEntry.js" to "main": "index.js". Also delete the original App.js file at the root of the project as it leads to compilation problems in certain Expo templates.
Sent from ProtonMail for iOS
…On Wed, Sep 15, 2021 at 5:41 AM, Nick Römer ***@***.***> wrote:
I am following the [react native instructions](https://figwheel.org/docs/react-native.html) for Android with the web simulator using expo start --web (I can't install any other simulator on termux).
When I run clj -m figwheel.main -b android -r my browser displays an error
TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Module.<anonymous>
/data/data/com.termux/files/home/fig-app/target/public/cljs-out/android_rn/figwheel-bridge.js:165
162 | ReactNative.AppRegistry.registerComponent(options.appName, () => createBridgeComponent(options));
163 | }
164 |
> 165 | module.exports = {
166 | shimRequire: shimRequire,
167 | start: startApp,
168 | createBridgeComponent: createBridgeComponentView compiled
Module../target/public/cljs-out/android_rn/figwheel-bridge.js
http://localhost:19006/static/js/bundle.js:60587:30
__webpack_require__
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
786 | };
787 |
788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 790 |
791 | // Flag the module as loaded
792 | module.l = true;View compiled
fn
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:100
97 | );
98 | hotCurrentParents = [];
99 | }
> 100 | return __webpack_require__(request);
| ^ 101 | };
102 | var ObjectFactory = function ObjectFactory(name) {
103 | return {View compiled
Module../index.js
/data/data/com.termux/files/home/fig-app/index.js:6
3 | import {krellNpmDeps} from "./target/public/cljs-out/android/krell_npm_deps.js";
4 | var options = {optionsUrl: "http://localhost:9500/cljs-out/android/cljsc_opts.json",
5 | autoRefresh: true};
> 6 | var figBridge = require("./target/public/cljs-out/android_rn/figwheel-bridge.js");
7 | figBridge.shimRequire({...assets, ...krellNpmDeps, ...npmDeps});
8 | import { registerRootComponent } from 'expo';
9 | registerRootComponent(figBridge.createBridgeComponent(options));View compiled
__webpack_require__
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
786 | };
787 |
788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 790 |
791 | // Flag the module as loaded
792 | module.l = true;View compiled
fn
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:100
97 | );
98 | hotCurrentParents = [];
99 | }
> 100 | return __webpack_require__(request);
| ^ 101 | };
102 | var ObjectFactory = function ObjectFactory(name) {
103 | return {View compiled
1
http://localhost:19006/static/js/bundle.js:60616:18
__webpack_require__
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
786 | };
787 |
788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 790 |
791 | // Flag the module as loaded
792 | module.l = true;View compiled
(anonymous function)
/data/data/com.termux/files/home/fig-app/webpack/bootstrap:856
853 |
854 |
855 | // Load entry module and return exports
> 856 | return hotCreateRequire(1)(__webpack_require__.s = 1);
| ^ 857 | View compiled
(anonymous function)
http://localhost:19006/static/js/bundle.js:860:10
On [this page](https://flaviocopes.com/cannot-assign-readonly-property-export/) they say that the JS code needs to be ES instead of CommonJS. Following their hint I can get it to work when I replace the following code at the end of /data/data/com.termux/files/home/fig-app/target/public/cljs-out/android_rn/figwheel-bridge.js:165
module.exports = {
shimRequire: shimRequire,
start: startApp,
createBridgeComponent: createBridgeComp
};
with
export {
shimRequire,
startApp as start,
createBridgeComponent
};
However, this is file dynamically created by figwheel and overwritten everytime I restart figwheel. The code needs to be fixed upstream.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#304), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAAUQBOJ2OFYC5XH7JSJYTUCCA75ANCNFSM5ECH2KPQ).
|
Yes.
… On 15/09/2021 19:01 Bruce Hauman ***@***.***> wrote:
Did you follow these instructions?
> If you are using Expo edit package.jsonand change "main": "node_modules/expo/AppEntry.js" to "main": "index.js". Also delete the original App.js file at the root of the project as it leads to compilation problems in certain Expo templates.
Sent from ProtonMail for iOS
On Wed, Sep 15, 2021 at 5:41 AM, Nick Römer ***@***.***> wrote:
> I am following the [react native instructions](https://figwheel.org/docs/react-native.html) for Android with the web simulator using expo start --web (I can't install any other simulator on termux).
> When I run clj -m figwheel.main -b android -r my browser displays an error
>
> TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
>
> Module.<anonymous>
>
> /data/data/com.termux/files/home/fig-app/target/public/cljs-out/android_rn/figwheel-bridge.js:165
>
> 162 | ReactNative.AppRegistry.registerComponent(options.appName, () => createBridgeComponent(options));
> 163 | }
> 164 |
>> 165 | module.exports = {
> 166 | shimRequire: shimRequire,
> 167 | start: startApp,
> 168 | createBridgeComponent: createBridgeComponentView compiled
>
> Module../target/public/cljs-out/android_rn/figwheel-bridge.js
>
> http://localhost:19006/static/js/bundle.js:60587:30
>
> __webpack_require__
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
>
> 786 | };
> 787 |
> 788 | // Execute the module function
>> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
> | ^ 790 |
> 791 | // Flag the module as loaded
> 792 | module.l = true;View compiled
>
> fn
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:100
>
> 97 | );
> 98 | hotCurrentParents = [];
> 99 | }
>> 100 | return __webpack_require__(request);
> | ^ 101 | };
> 102 | var ObjectFactory = function ObjectFactory(name) {
> 103 | return {View compiled
>
> Module../index.js
>
> /data/data/com.termux/files/home/fig-app/index.js:6
>
> 3 | import {krellNpmDeps} from "./target/public/cljs-out/android/krell_npm_deps.js";
> 4 | var options = {optionsUrl: "http://localhost:9500/cljs-out/android/cljsc_opts.json",
> 5 | autoRefresh: true};
>> 6 | var figBridge = require("./target/public/cljs-out/android_rn/figwheel-bridge.js");
> 7 | figBridge.shimRequire({...assets, ...krellNpmDeps, ...npmDeps});
> 8 | import { registerRootComponent } from 'expo';
> 9 | registerRootComponent(figBridge.createBridgeComponent(options));View compiled
>
> __webpack_require__
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
>
> 786 | };
> 787 |
> 788 | // Execute the module function
>> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
> | ^ 790 |
> 791 | // Flag the module as loaded
> 792 | module.l = true;View compiled
>
> fn
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:100
>
> 97 | );
> 98 | hotCurrentParents = [];
> 99 | }
>> 100 | return __webpack_require__(request);
> | ^ 101 | };
> 102 | var ObjectFactory = function ObjectFactory(name) {
> 103 | return {View compiled
>
> 1
>
> http://localhost:19006/static/js/bundle.js:60616:18
>
> __webpack_require__
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:789
>
> 786 | };
> 787 |
> 788 | // Execute the module function
>> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
> | ^ 790 |
> 791 | // Flag the module as loaded
> 792 | module.l = true;View compiled
>
> (anonymous function)
>
> /data/data/com.termux/files/home/fig-app/webpack/bootstrap:856
>
> 853 |
> 854 |
> 855 | // Load entry module and return exports
>> 856 | return hotCreateRequire(1)(__webpack_require__.s = 1);
> | ^ 857 | View compiled
>
> (anonymous function)
>
> http://localhost:19006/static/js/bundle.js:860:10
>
> On [this page](https://flaviocopes.com/cannot-assign-readonly-property-export/) they say that the JS code needs to be ES instead of CommonJS. Following their hint I can get it to work when I replace the following code at the end of /data/data/com.termux/files/home/fig-app/target/public/cljs-out/android_rn/figwheel-bridge.js:165
>
> module.exports = {
> shimRequire: shimRequire,
> start: startApp,
> createBridgeComponent: createBridgeComp
> };
>
> with
>
> export {
> shimRequire,
> startApp as start,
> createBridgeComponent
> };
>
> However, this is file dynamically created by figwheel and overwritten everytime I restart figwheel. The code needs to be fixed upstream.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, [view it on GitHub](#304), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAAUQBOJ2OFYC5XH7JSJYTUCCA75ANCNFSM5ECH2KPQ).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #304 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIFK3XFDZ6OMCXSWY2OTBDUCDGOJANCNFSM5ECH2KPQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am following the react native instructions for Android with the web simulator using
expo start --web
(I can't install any other simulator on termux).When I run
clj -m figwheel.main -b android -r
my browser displays an errorOn this page they say that the JS code needs to be ES instead of CommonJS. Following their hint I can get it to work when I replace the following code at the end of /data/data/com.termux/files/home/fig-app/target/public/cljs-out/android_rn/figwheel-bridge.js:165
with
However, this is file dynamically created by figwheel and overwritten everytime I restart figwheel. The code needs to be fixed upstream.
The text was updated successfully, but these errors were encountered: