I have a finished Polymer 1 application that has not been released yet, so I decided to upgrade it to Polymer 2.
In bower dependencies I used to have
"polymer": "Polymer/polymer#^1.4.0",
"platinum-elements": "PolymerElements/platinum-elements#^2.0.0",
"paper-elements": "PolymerElements/paper-elements#^1.0.7",
"neon-elements": "PolymerElements/neon-elements#^1.0.0",
"iron-elements": "PolymerElements/iron-elements#^1.0.9",
"gold-elements": "PolymerElements/gold-elements#^1.0.1",
"app-route": "PolymerElements/app-route#^1.0.1",
Digging deep I discovered, that PolymerElements/paper-elements does not really pull down version 2 of elements.
So, now my bower looks like this:
"dependencies": {
"polymer": "Polymer/polymer#^2.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"app-route": "PolymerElements/app-route#^2.0.0",
"app-layout": "PolymerElements/app-layout#^2.0.0",
"neon-animation": "PolymerElements/neon-animation#^2.0.0",
"paper-badge": "PolymerElements/paper-badge#^2.0.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^2.0.0",
"paper-button": "PolymerElements/paper-button#^2.0.0",
"paper-card": "PolymerElements/paper-card#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dialog": "PolymerElements/paper-dialog#^2.0.0",
"paper-dialog-behavior": "PolymerElements/paper-dialog-behavior#^2.0.0",
"paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",
"paper-fab": "PolymerElements/paper-fab#^2.0.0",
"paper-header-panel": "PolymerElements/paper-header-panel#^2.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.0",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-menu-button": "PolymerElements/paper-menu-button#^2.0.0",
"paper-progress": "PolymerElements/paper-progress#^2.0.0",
"paper-radio-button": "PolymerElements/paper-radio-button#^2.0.0",
"paper-radio-group": "PolymerElements/paper-radio-group#^2.0.0",
"paper-ripple": "PolymerElements/paper-ripple#^2.0.0",
"paper-slider": "PolymerElements/paper-slider#^2.0.0",
"paper-spinner": "PolymerElements/paper-spinner#^2.0.0",
"paper-styles": "PolymerElements/paper-styles#^2.0.0",
"paper-swatch-picker": "PolymerElements/paper-swatch-picker#^2.0.0",
"paper-tabs": "PolymerElements/paper-tabs#^2.0.0",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-toggle-button": "PolymerElements/paper-toggle-button#^2.0.0",
"paper-tooltip": "PolymerElements/paper-tooltip#^2.0.0",
"iron-a11y-announcer": "PolymerElements/iron-a11y-announcer#^2.0.0",
"iron-a11y-keys": "PolymerElements/iron-a11y-keys#^2.0.0",
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^2.0.0",
"iron-ajax": "PolymerElements/iron-ajax#^2.0.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^2.0.0",
"iron-behaviors": "PolymerElements/iron-behaviors#^2.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^2.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^2.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^2.0.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^2.0.0",
"iron-dropdown": "PolymerElements/iron-dropdown#^2.0.0",
"iron-fit-behavior": "PolymerElements/iron-fit-behavior#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-icons": "PolymerElements/iron-icons#^2.0.0",
"iron-iconset": "PolymerElements/iron-iconset#^2.0.0",
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0",
"iron-image": "PolymerElements/iron-image#^2.0.0",
"iron-jsonp-library": "PolymerElements/iron-jsonp-library#^2.0.0",
"iron-list": "PolymerElements/iron-list#^2.0.0",
"iron-location": "PolymerElements/iron-location#^2.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"iron-swipeable-container": "PolymerElements/iron-swipeable-container#^1.0.3",
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^2.0.0",
"iron-form": "PolymerElements/iron-form#^2.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^2.0.0",
"iron-input": "PolymerElements/iron-input#^2.0.0",
"iron-label": "PolymerElements/iron-label#^2.0.0",
"iron-localstorage": "PolymerElements/iron-localstorage#^2.0.0",
"iron-menu-behavior": "PolymerElements/iron-menu-behavior#^2.0.0",
"iron-meta": "PolymerElements/iron-meta#^2.0.0",
"iron-range-behavior": "PolymerElements/iron-range-behavior#^2.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^2.0.0",
"iron-scroll-target-behavior": "PolymerElements/iron-scroll-target-behavior#^2.0.0",
"iron-scroll-threshold": "PolymerElements/iron-scroll-threshold#^2.0.0",
"iron-selector": "PolymerElements/iron-selector#^2.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^2.0.0",
"iron-validatable-behavior": "PolymerElements/iron-validatable-behavior#^2.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^2.0.0",
"gold-elements": "PolymerElements/gold-elements#^1.0.1",
"paper-date-picker": "polymer-paper-date-picker#^1.2.0",
"paper-time-picker": "bendavis78/paper-time-picker#^1.1.4",
"paper-password-input": "^2.1.0",
"vaadin-upload": "^2.0.0",
"socket.io-client": "^2.0.3",
"chart.js": "^2.6.0"
},
"ignore": [],
"resolutions": {
"iron-a11y-announcer": "1 - 2",
"webcomponentsjs": "^v1.0.0",
"polymer": "^2.0.0",
"iron-a11y-keys-behavior": "^2.0.0",
"iron-autogrow-textarea": "1 - 2",
"iron-collapse": "^2.0.0",
"iron-behaviors": "^2.0.0",
"iron-fit-behavior": "1 - 2",
"iron-dropdown": "^2.0.0",
"iron-flex-layout": "^2.0.0",
"iron-icon": "1 - 2",
"iron-iconset-svg": "1 - 2",
"iron-image": "^2.0.0",
"iron-media-query": "1 - 2",
"iron-checked-element-behavior": "^2.0.0",
"iron-list": "^2.0.0",
"iron-overlay-behavior": "1 - 2",
"iron-pages": "^2.0.0",
"iron-form-element-behavior": "^2.0.0",
"iron-input": "1 - 2",
"iron-scroll-target-behavior": "^2.0.0",
"iron-menu-behavior": "^2.0.0",
"iron-range-behavior": "1 - 2",
"iron-meta": "^2.0.0",
"iron-resizable-behavior": "^2.0.0",
"iron-selector": "^2.0.0",
"iron-validator-behavior": "^2.0.0",
"iron-validatable-behavior": "^2.0.0",
"paper-button": "^2.0.0",
"paper-icon-button": "^2.0.0",
"paper-input": "^2.0.0",
"paper-progress": "^2.0.0",
"paper-ripple": "^2.0.0",
"paper-styles": "^2.0.0",
"paper-behaviors": "^2.0.0",
"neon-animation": "^2.0.0"
}
And I'm having whole bunch of problems.
Simple iron-form like this
<iron-form id="loginForm">
<form action="/" method="POST">
<paper-input name="uid" label="Username" type="text" required auto-validate></paper-input>
<paper-input name="pwd" label="Password" type="password" required auto-validate></paper-input>
<paper-button class="primary" raised on-tap="_submit">Log in
<button type="submit" class="no-style"></button>
</paper-button>
</form>
</iron-form>
Where in my element I have
_submit() {
this.$.loginForm.submit();
}
connectedCallback() {
super.connectedCallback();
this.$.loginForm.addEventListener('iron-form-presubmit', function (event) {
event.preventDefault();
myapp.auth.login(this.uid.value, this.pwd.value);
});
}
First, when I start typing username or password, the label will not float up and will show behind the username.
Second calling .submit() or .validate() on iron-form causes 'this.inputElement.validate is not a function' right here https://github.com/PolymerElements/paper-input/blob/v2.0.1/paper-input-behavior.html#L437 and that's because this.inputElement is undefined.
Am I missing something? The polymer-2-starter-kit template form polymer-cli seems to be targeting rc and hardly installs any of UI elements.
Thanks.
It's recommended to upgrade your component dependencies one at a time. And, make sure to read the change logs, and take notice of features that may break.
Ok, thanks to Frank R. I have started with polymer-2-starter-kit and kept adding paper elements as needed. Bower did not ask for any resolutions (I did bower cash clean).
Here is my current and working bower:
"dependencies": {
"polymer": "Polymer/polymer#^2.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"app-layout": "PolymerElements/app-layout#^2.0.0",
"app-route": "PolymerElements/app-route#^2.0.0",
"iron-ajax": "PolymerElements/iron-ajax#^2.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^2.0.0",
"iron-form": "PolymerElements/iron-form#^2.0.0",
"iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^2.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^2.0.0",
"iron-icon": "PolymerElements/iron-icon#^2.0.0",
"iron-iconset-svg": "PolymerElements/iron-iconset-svg#^2.0.0",
"iron-label": "PolymerElements/iron-label#^2.0.0",
"iron-list": "PolymerElements/iron-list#^2.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^2.0.0",
"iron-pages": "PolymerElements/iron-pages#^2.0.0",
"iron-selector": "PolymerElements/iron-selector#^2.0.0",
"paper-badge": "PolymerElements/paper-badge#^2.0.0",
"paper-button": "PolymerElements/paper-button#^2.0.0",
"paper-checkbox": "PolymerElements/paper-checkbox#^2.0.0",
"paper-dialog": "PolymerElements/paper-dialog#^2.0.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.0.0",
"paper-fab": "PolymerElements/paper-fab#^2.0.0",
"paper-icon-button": "PolymerElements/paper-icon-button#^2.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.0",
"paper-item": "PolymerElements/paper-item#^2.0.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.0.0",
"paper-toast": "PolymerElements/paper-toast#^2.0.0",
"paper-tooltip": "PolymerElements/paper-tooltip#^2.0.0",
"paper-password-input": "^2.1.0",
"vaadin-upload": "^2.0.0",
"socket.io-client": "^2.0.3",
"chart.js": "^2.6.0"
},
Related
I have two apps in different accounts, rejected under the topic 2.3.1 - Performance, after upgrading to the React Native 0.59.3. Nothing was changed in this apps, except the RN upgrade.
But, both of apps are not using obfuscated code, selector mangling, or features meant to subvert the App Review process. Both are apps thats change it's contents naturally based on the API data, like many others apps like Facebook, Twitter, Instagram, etc.
Both are simples apps created with react-native init and published more than 1 year ago for Android and iOS. We are not using codepush, test A/B or others technique to change app behaviour in runtime.
Anyone suffering with the same rejection or have any tips to solve this problem?
Apple rejection message:
Guideline 2.3.1 - Performance
We discovered that your app contains obfuscated code, selector
mangling, or features meant to subvert the App Review process by
changing this app's concept after approval to the App Store.
The next submission of this app may require a longer review time, and
this app will not be eligible for an expedited review until this issue
is resolved.
Next Steps
Review the Performance section of the App Store Review Guidelines.
Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer
Program.
Once your app is fully compliant, resubmit your app for review.
Submitting apps designed to mislead or harm customers or evade the
review process may result in the termination of your Apple Developer
Program account. Review the Terms & Conditions of the Apple Developer
Program to learn more about our policies regarding termination.
If you believe your app is compliant with the App Store Review
Guidelines, you may submit an appeal. Alternatively, you may provide
additional details about your app by replying directly to this
message.
package.json's:
App A:
{
"name": "app A",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#react-native-community/async-storage": "1.2.2",
"#react-native-community/netinfo": "1.4.1",
"#remobile/react-native-action-sheet": "1.0.2",
"eureka-rn-components": "git+file:../gileade-eureka-rn-components#02c50a043070648205def50940c1282d2b749c89",
"functional-masks": "git+https://github.com/ktabriga/functional-masks.git#d5f5f01fe6731fc1c0879b8afb8f239591a2f984",
"lodash": "4.17.2",
"moment": "2.16.0",
"normalizr": "3.1.0",
"numeral": "1.5.3",
"prop-types": "15.6.2",
"ramda": "0.23.0",
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-action-button": "2.6.2",
"react-native-autocomplete-input": "3.6.0",
"react-native-datepicker": "1.6.0",
"react-native-deprecated-custom-components": "0.1.2",
"react-native-device-info": "0.25.1",
"react-native-dropdownalert": "3.9.1",
"react-native-elements": "0.18.0",
"react-native-fcm": "13.3.3",
"react-native-global-props": "1.1.1",
"react-native-image-crop-picker": "0.18.2",
"react-native-infinite-scroll-view": "0.4.5",
"react-native-masked-text": "1.5.2",
"react-native-modal-selector": "1.0.2",
"react-native-permissions": "1.1.1",
"react-native-progress-circle": "2.0.1",
"react-native-side-menu": "1.1.3",
"react-native-simple-modal": "6.0.0",
"react-native-swiper": "1.5.5",
"react-native-vector-icons": "6.2.0",
"react-redux": "4.4.6",
"redux": "3.6.0",
"redux-logger": "2.7.4",
"redux-persist": "4.0.0-beta1",
"redux-promise-middleware": "4.1.0",
"redux-thunk": "2.1.0",
"reselect": "2.5.4",
"string-mask": "0.3.0",
"url-join": "4.0.0"
},
"jest": {
"preset": "jest-react-native"
},
"devDependencies": {
"#babel/core": "7.4.0",
"#babel/runtime": "7.4.2",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.5.0",
"eslint": "5.16.0",
"jest": "24.5.0",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.8.3"
}
}
App B:
{
"name": "app B",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-community/async-storage": "1.3.3",
"axios": "0.18.0",
"bluebird": "3.5.1",
"jwt-decode": "2.2.0",
"moment": "2.21.0",
"prop-types": "15.6.1",
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-charts-wrapper": "0.4.2",
"react-native-datepicker": "1.7.2",
"react-native-device-info": "0.25.1",
"react-native-elements": "0.19.0",
"react-native-exit-app": "1.0.0",
"react-native-fcm": "14.1.0",
"react-native-keyboard-manager": "4.0.13-10",
"react-native-simple-dialogs": "1.1.0",
"react-native-splash-screen": "3.1.1",
"react-native-vector-icons": "6.2.0",
"react-navigation": "1.5.2",
"vanilla-masker": "1.2.0",
"wolfy87-eventemitter": "5.2.5"
},
"devDependencies": {
"#babel/core": "7.4.0",
"#babel/runtime": "7.4.2",
"#react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.5.0",
"babel-plugin-transform-remove-console": "6.9.0",
"eslint": "5.16.0",
"jest": "24.5.0",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
My app also got rejected. However after replying in the resolution centre I have said that I do not use code obfuscating and I have asked for details about the reason for rejection. And just like that, I've got a notification that my app is in review and like 10 seconds later my app was approved and released :-)
To me this seems like either a bug on Apple side, or it was triggered by one of the popular frameworks, like AFNetworking, Realm, etc (where they use NSStringFromSelector, NSStringFromClass etc) but since it was large scale and everyone was explaining the usage in the same way the apps gets approved almost automatically (but you have to reply in the resolution centre in order to trigger the second review process). Hope this helps.
I have a Vue-CLI webapp that needs to support IE11. In package.json we have set:
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8",
"ie 11"
]
and this seems to work for the generated app.x.js files: they don't contain any ... operators for instance.
However, the generated chunk-vendors.x.js do contain ... operators, and hence fail on IE11.
Relevant parts of the package.json:
"devDependencies": {
"#vue/cli-plugin-babel": "^3.3.0",
"#vue/cli-plugin-eslint": "^3.3.0",
"#vue/cli-service": "^3.3.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"pug": "^2.0.3",
"pug-plain-loader": "^1.0.0",
"vue-cli-plugin-pug": "^1.0.7",
"vue-template-compiler": "^2.5.21"
},
There are no relevant changes in vue.config.js, so the default behaviour is being used.
What do I need to change to ensure chunk-vendors.x.js is transpiled for IE11?
The answer seems to be, not so much "make sure all dependencies are transpiled" (which apparently can cause a lot of problems), but "make sure the specific dependencies which are causing issues are transpiled".
You can do this by adding a line to vue.config.js:
transpileDependencies: ['/node_modules/myproblematicmodule/']
I'm new to Aurelia, trying to implement some 'simple' dynamic routing with an id.
config.map([
{ route: 'questions/:id', . . .}
]);
I receive a runtime error which indicates I'm missing an activate() method.
aurelia-history.js:4 Uncaught (in promise) Error: History must implement activate().
at mi (aurelia-history.js:4)
at History.activate (aurelia-history.js:13)
at AppRouter.activate (aurelia-router.js:1743)
at aurelia-router.js:1722
I get that there is an activate() missing and it's dropping through to the prototype and throwing this error, I just can't figure out where to add the activate(). I have it in my module, but should I somehow have one in my App class or this history object?
Thanks
-John
Ok, for the benefit of other strugglers I tried to retrace my steps and piece together how I solved my problem - the challenge was I changed many variables.
But I believe I was able to re-create my error and I broke my application in the same way as before.
The error may have started appearing when I upgraded my aurelia-router version from 1.2.1 to 1.6.2.
This was my old package.json:
{
"name": "ClientWeb",
"private": true,
"version": "0.0.0",
"devDependencies": {
"#types/webpack-env": "^1.13.0",
"aspnet-webpack": "^2.0.1",
"aurelia-bootstrapper": "^2.0.1",
"aurelia-fetch-client": "^1.0.1",
"aurelia-framework": "^1.1.0",
"aurelia-loader-webpack": "^2.0.0",
"aurelia-pal": "^1.3.0",
"aurelia-router": "^1.2.1",
"aurelia-webpack-plugin": "^2.0.0-rc.2",
"bootstrap": "^3.3.7",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.11.1",
"html-loader": "^0.4.5",
"isomorphic-fetch": "^2.2.1",
"jquery": "^3.2.1",
"json-loader": "^0.5.4",
"style-loader": "^0.16.1",
"ts-loader": "^2.0.3",
"typescript": "^2.2.2",
"url-loader": "^0.5.8",
"webpack": "^2.3.3",
"webpack-hot-middleware": "^2.18.0"
},
"dependencies": {
"#types/vis": "^4.21.7",
"vis": "^4.21.0"
}
}
At the time I was upgrading several libraries to the latest versions, but I tried reverting back to this original package.json and just updated the aurelia-router version - it generates the original error.
Hope this helps someone.
-John
The reason you have this issue is because you didn't include aurelia-history-browser in your plugins via: aurelia.use.history() or aurelia.use.standardConfiguration().
The aurelia-history-browser module implements the aurelia-history abstract class History, which is a wrapper around native History of browser. The abstract class History basically throw an error with the method name when you call it, like the error you saw.
I'm just simply trying to start metro bundler to serve the app. Here's the error:
TypeError: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "StringLiteral"
at Object.validate (/Users/tyler/Code/.../node_modules/#babel/types/lib/definitions/utils.js:128:13)
at Object.validate (/Users/tyler/Code/.../node_modules/#babel/types/lib/validators/validate.js:17:9)
at NodePath._replaceWith (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/replacement.js:194:9)
at NodePath.replaceWith (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/replacement.js:178:8)
at PluginPass.MemberExpression (/Users/tyler/Code/.../node_modules/babel-plugin-transform-inline-environment-variables/lib/index.js:19:18)
at newFn (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/tyler/Code/.../node_modules/#babel/traverse/lib/context.js:118:16)
which means something like Platform.OS = "ios" is transformed into "ios" = "ios": like so <- That PR also addresses the TypeError being thrown for the process.env which seems to be the case for me. My stack trace references ...babel-plugin-transform-inline-environment-variables/lib/index.js:19:18 which deals exclusively with setting process.env. There are only two places in my code using a var from process.env and neither are used on the left side of an assignment.
PR 45 for the metro bundler was merged way back in 2017 though. And I'm using the latest version btw, this is occurring when trying to start up the bundler with the script "NODE_ENV=development npm start -- --reset-cache". Note that I am using the reset cache flag as mentiond here
A coworker suggested the error may be cause by a react-native plugin, but I haven't uncovered it yet if that is the case. We did just migrate this app to Babel 7, fyi. I'm hitting a wall now on ideas and the google trail is growing stale. What else could be the cause of this error?
Here are the dependencies from my package.json in case it helps:
}
...
"dependencies": {
"#babel/runtime": "^7.0.0",
"lodash.capitalize": "^4.2.1",
"lodash.debounce": "^4.0.8",
"lodash.find": "^4.6.0",
"phoenix": "^1.3.4",
"prettier": "^1.14.2",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-native": "0.57.0",
"react-native-firebase": "^4.3.8",
"react-native-keep-awake": "^3.1.0",
"react-native-linear-gradient": "^2.4.2",
"react-native-router-flux": "^4.0.1",
"react-native-swiper": "^1.5.13",
"react-native-tts": "^2.0.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"spokestack-react-native": "0.0.2"
},
"devDependencies": {
"#babel/plugin-proposal-object-rest-spread": "^7.0.0",
"#babel/plugin-transform-runtime": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"imagemin": "^6.0.0",
"imagemin-jpegtran": "^5.0.2",
"imagemin-optipng": "^5.2.1",
"imagemin-svgo": "^7.0.0",
"jest": "^23.6.0",
"metro-react-native-babel-preset": "^0.45.2",
"pre-commit": "^1.2.2",
"precise-commits": "^1.0.2",
"react-test-renderer": "^16.4.2",
"redux-mock-store": "^1.5.3"
},
...
}
...and additionally, the babel.config.js as per babel 7
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'#babel/plugin-transform-runtime',
'#babel/plugin-proposal-object-rest-spread',
'transform-inline-environment-variables'
]
}
UPDATE: I used grep within the react-* packages to find additional lines where process.env were used as a lefthand assignment. Only found a few, but couldn't resolve the issue.
The error you see in the log is related to babel-plugin-transform-inline-environment-variables. If you exclude it from your configuration file, the build should pass.
I'm facing the same issue and haven't found a good solution so far, so try to workaround a way how you pass your environment variables.
I'm working on an react-native app since 3 months, and we're currently using v0.21.
In an attempt to upgrade the app in order to fix a bug, I:
ran brew update && brew upgrade
Made some change to package.json
ran npm install
ran npm update -g react-native-cli to get the v0.1.10 locally
At this point I tried to run the app, but either in iOS or Android, I've got the same error:
So Logically I got back to origin/master, remove my node_modules folder, and reinstalled the react-native-cli v0.1.7 ... But I've got the same error !!
My package.json looks like that:
{
"name": "XXXXXX",
"version": "0.0.1",
"private": true,
"dependencies": {
"awesome-phonenumber": "^1.0.10",
"buffer": "^3.6.0",
"immutable": "^3.7.6",
"react-native": "^0.21.0",
"react-native-animatable": "^0.5.0",
"react-native-blur": "^0.7.10",
"react-native-button": "^1.3.1",
"react-native-code-push": "^1.5.3-beta",
"react-native-date": "^1.0.3",
"react-native-device-info": "^0.6.0",
"react-native-drawer-layout": "^0.4.0",
"react-native-facebook-ios": "file:lib/react-native-facebook-ios",
"react-native-facebook-login": "^1.0.2",
"react-native-floating-label-text-input": "0.0.8",
"react-native-google-places-autocomplete": "^1.1.6",
"react-native-material-kit": "^0.2.4",
"react-native-modalbox": "^1.3.1",
"react-native-onesignal": "file:lib/react-native-onesignal",
"react-native-parallax": "^0.2.2",
"react-native-parallax-scroll-view": "^0.16.17",
"react-native-router-flux": "^2.2.6",
"react-native-scrollable-tab-view": "^0.3.5",
"react-native-sync-now-android": "file:lib/react-native-sync-now-android",
"react-native-sync-now-ios": "file:lib/react-native-sync-now-ios",
"react-native-timer-ios": "file:lib/react-native-timer-ios",
"react-native-twitter-ios": "file:lib/react-native-twitter-ios",
"react-native-twitter-login": "0.0.2",
"react-native-utils": "^1.0.1",
"react-native-vector-icons": "^1.0.3",
"react-native-webrtc": "^0.1.5",
"react-redux": "^3.1.0",
"redux": "^3.0.2",
"redux-logger": "^2.0.1",
"redux-thunk": "^1.0.0",
"rnpm": "^1.4.1"
},
"scripts": {
"start": "react-native start",
"postinstall": "sh scripts/postinstall.sh"
},
"devDependencies": {
"react-native-cli": "^0.1.7"
}
}
I'm sure the problem is in the version of my tools because everything happened after I updated them and the code is the same
Here's the versions:
Watchman 4.4.0
Flow 0.22.1
react-native-cli 0.1.7
Can someone help me with this ?
Fixed it !
Because I must have upgraded packagers, it did not like the:
export default variable = {};
It prefers:
const variable = {};
export default variable;
Lost 24 hours on this...