renative icon indicating copy to clipboard operation
renative copied to clipboard

TypeError: (0 , tslib_1.__spreadArray) is not a function — Upgrade to 0.36.0 from 0.34.0

Open crewtaylorfd opened this issue 2 years ago • 1 comments

Describe the bug I have upgraded rnv from 0.34.0 to 0.36.0 and am getting the following error. I have cleaned everything when updating and ran rnv run -R -p tizen --hosted and I got the following error.

[ error ] [start] (0 , tslib_1.__spreadArray) is not a function
TypeError: (0 , tslib_1.__spreadArray) is not a function
    at module.exports (/proj/node_modules/@rnv/sdk-webpack/src/config/webpack.config.js:324:51)
    at /proj/node_modules/@rnv/sdk-webpack/src/scripts/start.js:71:20
    at new Promise (<anonymous>)
    at /proj/node_modules/@rnv/sdk-webpack/src/scripts/start.js:37:28
    at step (/proj/node_modules/tslib/tslib.js:141:27)
    at Object.next (/proj/node_modules/tslib/tslib.js:122:57)
    at /proj/node_modules/tslib/tslib.js:115:75
    at new Promise (<anonymous>)
    at __awaiter (/proj/node_modules/tslib/tslib.js:111:16)
    at /proj/node_modules/@rnv/sdk-webpack/src/scripts/start.js:37:16

To Reproduce Steps to reproduce the behavior:

  1. Build 0.34.0 template.
  2. Run on tizen hosted mode
  3. Upgrade rnv. npm install [email protected] -g
  4. rnv run -R -p tizen --hosted
  5. See error

crewtaylorfd avatar Jun 24 '22 17:06 crewtaylorfd

@crewtaylorfd did you achieve solve this problem?

alexkander avatar Aug 23 '22 19:08 alexkander

@crewtaylorfd Thanks for reporting this issue, is this still reproduced on latest version? Could you provide node versions, os type?

GabrieleKaceviciute avatar Jun 26 '23 14:06 GabrieleKaceviciute

I've tested on OS: macOS Monterey 12.6 Node Version: v16.14.2 RNV Version: 0.37.1 and this error occours:

│  🚀  BUNDLER STARTED | 7/20/2023, 4:52:32 PM                                 │
│  $ rnv run -R -p tizen --hosted                                              │
├──────────────────────────────────────────────────────────────────────────────┤
│  ReNative Version: 0.37.1                                                    │
│  Project Name ($package.name): retest                                        │
│  Project Version ($package.version): 0.1.0                                   │
│  Workspace ($.workspaceID): rnv                                              │
│  Platform (-p): tizen                                                        │
│  Engine ($.platforms.tizen.engine): engine-rn-web                            │
│  Template: @rnv/[email protected]                                      │
│  App Config (-c): app                                                        │
│  Build Scheme (-s): debug                                                    │
│  Target (-t): T-samsung-5.5-x86                                              │
│  Reset Project and Assets (-R): true                                         │
│  Supported Platforms: tizen                                                  │
│  Env Info: darwin | x64 | node v16.14.2                                      │
│  Executed Time: 0h:2m:13s:288ms                                              │
│                                                                              │
│ [ success ] [install] /next/dist/lib/find-pages-dir.js requires override by: /@flexn/plugins/pluginTemplates/next/overrides.json. FIXING...DONE
│                                                                              │
│  Project location:                                                           │
│  ./platformBuilds/app_tizen                                                  │
└──────────────────────────────────────────────────────────────────────────────┘
[ task ] [start] _runWebDevServer[1]
[ task ] [start] parsePlugins[2]
(node:50161) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:50161) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...

One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.

Compiled successfully!

You can now view retest in the browser.

  Local:            http://localhost:8087
  On Your Network:  http://192.168.1.144:8087

Note that the development build is not optimized.
To create a production build, use yarn build.

assets by path static/ 3.02 MiB
  asset static/js/bundle.js 2.71 MiB [emitted] (name: main) 1 related asset
  asset static/media/Inter-Light.58a136ec3193fa8a63e5.ttf 303 KiB [emitted] [immutable] [from: appConfigs/base/fonts/Inter-Light.ttf] (auxiliary name: main)
  asset static/media/logo.63d54a55b067ffc3e842.png 12.1 KiB [emitted] [immutable] [from: platformAssets/runtime/logo.png] (auxiliary name: main)
asset index.html 1.67 KiB [emitted]
asset asset-manifest.json 356 bytes [emitted]
runtime modules 28.5 KiB 14 modules
orphan modules 233 bytes [orphan] 1 module
modules by path ./node_modules/ 2.26 MiB 364 modules
modules by path ./platformAssets/ 3.19 KiB (javascript) 12.1 KiB (asset)
  javascript modules 3.1 KiB 2 modules
  ./platformAssets/renative.runtime.json 46 bytes [built] [code generated]
  ./platformAssets/runtime/logo.png 42 bytes (javascript) 12.1 KiB (asset) [built] [code generated]
modules by path ./src/ 15 KiB
  ./src/entry/index.web.ts 1.35 KiB [built] [code generated]
  ./src/app/index.tsx 6.4 KiB [built] [code generated]
  ./src/config.tsx 7.22 KiB [built] [code generated]
./index.js 1.04 KiB [built] [code generated]
./package.json 1 KiB [built] [code generated]
./appConfigs/base/fonts/Inter-Light.ttf 42 bytes (javascript) 303 KiB (asset) [built] [code generated]
webpack 5.88.2 compiled successfully in 5961 ms
ERROR in src/app/index.tsx:25:10
TS2786: 'View' cannot be used as a JSX component.
  Its instance type 'View' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'import("/Users/gabriele/Desktop/tests/retest/node_modules/@types/react-native/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
        Type '{}' is not assignable to type 'ReactNode'.
    23 |
    24 |     return (
  > 25 |         <View style={theme.styles.container}>
       |          ^^^^
    26 |             <Image
    27 |                 style={theme.styles.image}
    28 |                 source={ICON_LOGO}

ERROR in src/app/index.tsx:26:14
TS2786: 'Image' cannot be used as a JSX component.
  Its instance type 'Image' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'import("/Users/gabriele/Desktop/tests/retest/node_modules/@types/react-native/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
    24 |     return (
    25 |         <View style={theme.styles.container}>
  > 26 |             <Image
       |              ^^^^^
    27 |                 style={theme.styles.image}
    28 |                 source={ICON_LOGO}
    29 |                 {...testProps('template-starter-home-screen-renative-image')}

ERROR in src/app/index.tsx:31:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'import("/Users/gabriele/Desktop/tests/retest/node_modules/@types/react-native/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
    29 |                 {...testProps('template-starter-home-screen-renative-image')}
    30 |             />
  > 31 |             <Text style={theme.styles.textH2} {...testProps('template-starter-home-screen-welcome-message-text')}>
       |              ^^^^
    32 |                 {CONFIG.welcomeMessage}
    33 |             </Text>
    34 |             <Text style={theme.styles.textH2} {...testProps('template-starter-home-screen-version-number-text')}>

ERROR in src/app/index.tsx:34:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    32 |                 {CONFIG.welcomeMessage}
    33 |             </Text>
  > 34 |             <Text style={theme.styles.textH2} {...testProps('template-starter-home-screen-version-number-text')}>
       |              ^^^^
    35 |                 v {packageJson.version}
    36 |             </Text>
    37 |             <Text style={theme.styles.textH3}>

ERROR in src/app/index.tsx:37:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    35 |                 v {packageJson.version}
    36 |             </Text>
  > 37 |             <Text style={theme.styles.textH3}>
       |              ^^^^
    38 |                 {`platform: ${Api.platform}, factor: ${Api.formFactor}, engine: ${Api.engine}`}
    39 |             </Text>
    40 |             <Text style={theme.styles.textH3}>

ERROR in src/app/index.tsx:40:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    38 |                 {`platform: ${Api.platform}, factor: ${Api.formFactor}, engine: ${Api.engine}`}
    39 |             </Text>
  > 40 |             <Text style={theme.styles.textH3}>
       |              ^^^^
    41 |                 {
    42 |                     //@ts-ignore
    43 |                     `hermes: ${global.HermesInternal === undefined ? 'no' : 'yes'}`

ERROR in src/app/index.tsx:46:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    44 |                 }
    45 |             </Text>
  > 46 |             <Text style={theme.styles.textH3}>{`pixelRatio: ${pixelRatio}, ${fontScale}`}</Text>
       |              ^^^^
    47 |             <TouchableOpacity
    48 |                 onPress={toggle}
    49 |                 style={theme.styles.button}

ERROR in src/app/index.tsx:47:14
TS2786: 'TouchableOpacity' cannot be used as a JSX component.
  Its instance type 'TouchableOpacity' is not a valid JSX element.
    The types returned by 'render()' are incompatible between these types.
      Type 'import("/Users/gabriele/Desktop/tests/retest/node_modules/@types/react-native/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
    45 |             </Text>
    46 |             <Text style={theme.styles.textH3}>{`pixelRatio: ${pixelRatio}, ${fontScale}`}</Text>
  > 47 |             <TouchableOpacity
       |              ^^^^^^^^^^^^^^^^
    48 |                 onPress={toggle}
    49 |                 style={theme.styles.button}
    50 |                 {...testProps('template-starter-home-screen-try-my-button')}

ERROR in src/app/index.tsx:52:18
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
    50 |                 {...testProps('template-starter-home-screen-try-my-button')}
    51 |             >
  > 52 |                 <Text style={theme.styles.buttonText}>Try me!</Text>
       |                  ^^^^
    53 |             </TouchableOpacity>
    54 |         </View>
    55 |     );

ERROR in src/config.tsx:6:23
TS2307: Cannot find module '../platformAssets/runtime/logo.png' or its corresponding type declarations.
    4 | import CONFIG from '../platformAssets/renative.runtime.json';
    5 | import '../platformAssets/runtime/fontManager';
  > 6 | import ICON_LOGO from '../platformAssets/runtime/logo.png';
      |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    7 |
    8 | export function testProps(testId: string | undefined) {
    9 |     if (!testId) {

ERROR in src/entry/index.lng.ts:1:24
TS2307: Cannot find module '@lightningjs/sdk' or its corresponding type declarations.
  > 1 | import { Launch } from '@lightningjs/sdk';
      |                        ^^^^^^^^^^^^^^^^^^
    2 | import App from '../app';
    3 |
    4 | const Main = (...args) => Launch(App, ...args);

ERROR in src/pages/404.tsx:7:10
TS2786: 'View' cannot be used as a JSX component.
  Its instance type 'View' is not a valid JSX element.
     5 | export default function Page() {
     6 |     return (
  >  7 |         <View style={themeStyles.container}>
       |          ^^^^
     8 |             <Text style={themeStyles.textH2}>This is custom 404!</Text>
     9 |         </View>
    10 |     );

ERROR in src/pages/404.tsx:8:14
TS2786: 'Text' cannot be used as a JSX component.
  Its instance type 'Text' is not a valid JSX element.
     6 |     return (
     7 |         <View style={themeStyles.container}>
  >  8 |             <Text style={themeStyles.textH2}>This is custom 404!</Text>
       |              ^^^^
     9 |         </View>
    10 |     );
    11 | }

GabrieleKaceviciute avatar Jul 20 '23 13:07 GabrieleKaceviciute

Tested on 0.37.3 and even though cli shows some ts errors, app works fine, @crewtaylorfd can you confirm?

pauliusguzas avatar Sep 08 '23 08:09 pauliusguzas

Closing as issue was resolved, feel free to reopen if needed

GabrieleKaceviciute avatar Oct 17 '23 09:10 GabrieleKaceviciute