-
Notifications
You must be signed in to change notification settings - Fork 177
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
Can't make Linear Gradient RN to work #85
Comments
Solved by installing both dependencies in components directory. |
Suddenly react-native-linear-gradient stopped working again is intalled in components directory with react-native-web-linear-gradient next config: const withTM = require('next-transpile-modules')(['components' ], { module.exports = withTM({ I also would like help with oblador/react-native-vector-icons, I don't know how to configurate it properly with next js. Thank you |
I installed react-native-linear-gradient in the mobile package json and react-native-web-linear-gradient into next js folder and modified next.config.js like this:
module.exports = withTM({
webpack(config) {
config.resolve.alias = {
...(config.resolve.alias || {}),
'react-native$': 'react-native-web',
'react-native-linear-gradient': 'react-native-web-linear-gradient',
}
config.resolve.extensions = [
'.web.js',
'.web.ts',
'.web.tsx',
'.tsx', '.ts', '.js',
...config.resolve.extensions,
]
return config
},
})
I get the following error:
nextrn\node_modules\react-native-linear-gradient\index.js:1
import { Platform } from "react-native";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:988:16)
at Module._compile (internal/modules/cjs/loader.js:1036:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.react-native-linear-gradient (C:\Users\guill\OneDrive\Documentos\GitHub\nextrn\packages\web-nextjs.next\server\pages\index.js:407:18)
at webpack_require (C:\Users\guill\OneDrive\Documentos\GitHub\nextrn\packages\web-nextjs.next\server\pages\index.js:23:31)
at Module.../components/src/AppHeader.web.tsx (C:\Users\guill\OneDrive\Documentos\GitHub\nextrn\packages\web-nextjs.next\server\pages\index.js:334:86)
The text was updated successfully, but these errors were encountered: