create-rx-app icon indicating copy to clipboard operation
create-rx-app copied to clipboard

Project fails to run on Win10

Open alariej opened this issue 4 years ago • 2 comments

Hi, I am trying to create a ReactXP project on an actual Win10 machine. I installed VS 2019 Community and all requirements for creating react-native-windows projects (successfully tested following https://microsoft.github.io/react-native-windows/docs/getting-started). I use npx create-rx-app testrxp to create the project. But neither npm run start:web nor npm run start:windows successfully launch. I am using:

node --version: v12.9.1 (had to downgrade because of compiling issues with react-native-windows) npm --version: 6.10.2

Is there a proven setup for using create-rx-app on Win10?

Thanks.

C:\testrxp>npm run start:web

> [email protected] start:web C:\testrxp
> cross-env platform=web webpack-dev-server --config=web/webpack/dev.js --progress --colors --mode=development

Starting type checking service...
10% building 1/1 modules 0 activei 「wds」: Project is running at http://localhost:9999/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\testrxp\src
11% building 9/15 modules 6 active C:\testrxp\node_modules\webpack-dev-server\client\utils\createSocketUrl.jsi 「wdm」: wait until bundle finished: /
98% after emittingType checking in progress...
× 「wdm」:    37 modules

ERROR in ./src/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] C:\testrxp\src\index.tsx: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\\testrxp\\node_modules\\@babel\\preset-env\\lib\\index.js")
    at getPlugin (C:\testrxp\node_modules\@babel\preset-env\lib\index.js:67:11)
    at C:\testrxp\node_modules\@babel\preset-env\lib\index.js:258:62
    at Array.map (<anonymous>)
    at C:\testrxp\node_modules\@babel\preset-env\lib\index.js:258:43
    at C:\testrxp\node_modules\@babel\helper-plugin-utils\lib\index.js:19:12
    at C:\testrxp\node_modules\@babel\core\lib\config\full.js:199:14
    at Generator.next (<anonymous>)
    at Function.<anonymous> (C:\testrxp\node_modules\@babel\core\lib\gensync-utils\async.js:26:3)
    at Generator.next (<anonymous>)
    at step (C:\testrxp\node_modules\gensync\index.js:254:32)
i 「wdm」: Failed to compile.
No type errors found
Version: typescript 3.8.3
Time: 8817ms
C:\testrxp>npm run start:windows

> [email protected] start:windows C:\testrxp
> yarn rn-cli run-windows

yarn run v1.22.0
$ node scripts/react-native.js run-windows
Restoring NuGet packages
Error parsing solution file at C:\testrxp\windows\testrxp.sln: Exception has been thrown by the target of an invocation.
Failed to restore the NuGet packages
Done in 4.58s.

alariej avatar Mar 23 '20 09:03 alariej

OK, Web now works by adding the missing Babel Plugin entry in \node_modules\@babel\preset-env\lib\available-plugins.js

But the Windows build seems like a much bigger issue :-(

alariej avatar Mar 23 '20 11:03 alariej

Thanks @alariej - works for me!

This takes 4 steps:

  1. navigate to \node_modules\@babel\preset-env\lib\available-plugins.js

  2. add var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator")) with the other var's

  3. add "proposal-numeric-separator": _pluginProposalNumericSeparator.default, with the others in var _default so it gets exported with default

  4. run npm i @babel/plugin-proposal-numeric-separator

mgolden6 avatar Apr 18 '20 17:04 mgolden6