Closed ektaghag-eaton closed 11 months ago
Might just be me/my local setup, but I tried creating a new project (auth template) and running it fails:
I wish our CLI had a "precheck" for the user's dev environment before installing stuff, and output recommended dev environment set up.
been looking a this and several attempts move our code over to AwesomeProject but still had similar issues as @joebochill mentioned. There are several issues open here on compileC items https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+compilec
Also we are installing latest of react-native 72.7 and there seems to be more issues around that. RN 72.7 requires react-native-reanimated 3.0.X and we use 2.0.X https://docs.swmansion.com/react-native-reanimated/docs/guides/compatibility/#:~:text=To%20use%20Reanimated%20with%20the,stable%20version%20of%20React%20Native.
Some other findings
https://www.linkedin.com/pulse/react-native-developers-beware-xcode-143-update-heres-rajendran
https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+compilec
Might just be me/my local setup, but I tried creating a new project (auth template) and running it fails:
The Blank Template works fine. The auth and route template gives the error that you mentioned.
been looking a this and several attempts move our code over to AwesomeProject but still had similar issues as @joebochill mentioned. There are several issues open here on compileC items https://github.com/facebook/react-native/issues?q=is%3Aissue+is%3Aopen+compilec
Also we are installing latest of react-native 72.7 and there seems to be more issues around that. RN 72.7 requires react-native-reanimated 3.0.X and we use 2.0.X https://docs.swmansion.com/react-native-reanimated/docs/guides/compatibility/#:~:text=To%20use%20Reanimated%20with%20the,stable%20version%20of%20React%20Native.
Some other findings
https://www.linkedin.com/pulse/react-native-developers-beware-xcode-143-update-heres-rajendran
Fixed dependecies https://github.com/etn-ccis/blui-react-native-cli-templates/pull/102
@ektaghag-eaton after talking with you about failing tests on routing, I tested out a few things. In pxblue-extensions I tried appending jest(-.)? and spun up a new project but it gave error on jest-runner, so I added jest-runner which doesn't make sense because I specified jest(-.) which should cover anything for jest.
transformIgnorePatterns: [
"node_modules/(?!(jest(-.*)?|jest-runner|react-native|@react-native/*|react-native-vector-icons|react-native-animatable|react-native-reanimated|react-native-iphone-x-helper|react-native-modal|react-native-collapsible|@react-native/polyfills|react-native-status-bar-height|react-native-webview|react-native-webview/*)/)"
With the above configuration the test failed on private methods from babel, so I added the additional plugin '@babel/plugin-transform-private-methods', { "loose": true } to the routing project I spun up
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
// react-native-reanimated/plugin must be listed last
plugins: [
'react-native-reanimated/plugin',
['@babel/plugin-transform-private-methods', { "loose": true }]
],
};
My current error details
Details:
/blui-react-native-cli-templates/testrouting/node_modules/@brightlayer-ui/react-native-components/
node_modules/react-native-modal/dist/index.js:1 ({"Object<anonymous>":function(module,exports,require,__dirname,__filename,jest)
{import { ReactNativeModal } from './modal';
SyntaxError: Cannot use import statement outside a module
1 | import { Drawer, DrawerBody, DrawerHeader, DrawerNavGroup, NavItem } from '@brightlayer-ui/react-native-components'; | ^ 2 | import React, { useState, useCallback } from 'react'; 3 | import * as Colors from '@brightlayer-ui/colors'; 4 | import { StackNavigationProp } from '@react-navigation/stack';
Add @brightlayer-ui/react-native-components
to the transformIgnore pattern or change the test so it's not rendering the entire application like we did for React:
it('renders correctly', () => {
renderer.create(<View />);
});
Or both. It's probably best to add the entry to the transform ignore anyway if our components are going to be causing challenges with jest.
Add
@brightlayer-ui/react-native-components
to the transformIgnore pattern
Added @brightlayer-ui/react-native-components to the transformIgnore pattern
Add
@brightlayer-ui/react-native-components
to the transformIgnore pattern or change the test so it's not rendering the entire application like we did for React:it('renders correctly', () => { renderer.create(<View />); });
Or both. It's probably best to add the entry to the transform ignore anyway if our components are going to be causing challenges with jest.
Added @brightlayer-ui/react-native-components to the transformIgnore pattern
Fixes 4881 .
Changes proposed in this Pull Request:
Screenshots / Screen Recording (if applicable)
transformIgnorePatterns
.Blank Template
To Test:
Any specific feedback you are looking for?
yarn test
command