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

Not rendering on Chrome 41 / Google bot #945

Closed
pyankoff opened this issue May 13, 2018 · 5 comments
Closed

Not rendering on Chrome 41 / Google bot #945

pyankoff opened this issue May 13, 2018 · 5 comments

Comments

@pyankoff
Copy link

I'm using RNW with Next.js as in this example https://github.com/zeit/next.js/tree/canary/examples/with-react-native-web

Pages load in newer browsers, but fail to load in Googlebot / Chrome 41. Here is an error:

undefined is not a function
TypeError: undefined is not a function
    at Object.webpackJsonp../node_modules/react-native-web/dist/exports/Image/ImageStylePropTypes.js (node_modules/react-native-web/dist/exports/Image/ImageStylePropTypes.js:41:0)
    at __webpack_require__ (webpack:/webpack/bootstrap b028a92304fecd251efd:714:0)
    at fn (webpack:/webpack/bootstrap b028a92304fecd251efd:117:0)
    at Object.webpackJsonp../node_modules/react-native-web/dist/exports/StyleSheet/StyleSheetValidation.js (node_modules/react-native-web/dist/exports/StyleSheet/StyleSheetValidation.js:5:0)
    at __webpack_require__ (webpack:/webpack/bootstrap b028a92304fecd251efd:714:0)
    at fn (webpack:/webpack/bootstrap b028a92304fecd251efd:117:0)
    at http://localhost:3000/_next/-/page/index.js:3603:36
    at Array.forEach (native)
    at Object.create (node_modules/react-native-web/dist/exports/StyleSheet/StyleSheet.js:49:0)
    at Object.webpackJsonp../node_modules/react-native-web/dist/modules/createDOMProps/index.js (node_modules/react-native-web/dist/modules/createDOMProps/index.js:30:0)index.js:368 _callee3$runtime.js:62 tryCatchruntime.js:296 invokeruntime.js:114 module.exports.webpackJsonp../node_modules/regenerator-runtime/runtime.js.forEach.prototype.(anonymous function)asyncToGenerator.js:12 stepasyncToGenerator.js:27 _nextes6.promise.js:75 module.exports.webpackJsonp../node_modules/core-js/library/modules/es6.promise.js.runes6.promise.js:92 (anonymous function)_microtask.js:18 module.exports.webpackJsonp../node_modules/core-js/library/modules/_microtask.js.module.exports.flush

Any idea how to fix?

@pyankoff
Copy link
Author

Fixed it by using this plugin: https://github.com/sheerun/targets-webpack-plugin
Closing, not deleting just in case someone has the same problem.

@necolas
Copy link
Owner

necolas commented May 13, 2018

What's the problem that plugin is fixing?

@pyankoff
Copy link
Author

As far as I understood it transforms the code removing the features available only in newer browsers. Like arrow functions.

@necolas
Copy link
Owner

necolas commented May 13, 2018

The package is compiled before it is published, i.e., there are no arrow functions.

@pyankoff
Copy link
Author

Hm, I'm not sure then 😕Picked this explanation up from one of the comments on a similar issue vercel/next.js#3126 (comment)
Haven't looked into it myself, just slapped the plugin and moved on 😆

Repository owner locked as off-topic and limited conversation to collaborators May 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants