Open deeeed opened 2 years ago
I got a little further by creating a .npmrc
file with the content
legacy-peer-deps=true
However, then I got
> nx build
> nx run studio-ghibli-search-engine-web:build:production
> NX Cannot find module '@svgr/webpack'
Require stack:
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/react/plugins/with-react.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/react/plugins/webpack.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/apps/studio-ghibli-search-engine-web/webpack.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/utils/webpack/custom-webpack.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/dev-server/dev-server.impl.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/index.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/webpack/lib/get-webpack-config.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/webpack/webpack.impl.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/src/config/workspaces.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/src/command-line/run.js
- /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/bin/run-executor.js
Pass --verbose to see the stacktrace.
To fix this I did
npm i @svgr/webpack
After that build still failed, but now with errors like this
ERROR in ./libs/store/src/lib/films/films.slice.ts
Module build failed (from ./node_modules/@nrwl/webpack/src/utils/web-babel-loader.js):
SyntaxError: /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/libs/store/src/lib/films/films.slice.ts: Support for the experimental syntax '
flow' isn't currently enabled (20:8):
18 | export const FILMS_FEATURE_KEY = 'films';
19 |
> 20 | export interface FilmsState extends EntityState<FilmEntity> {
| ^
21 | loadingStatus: LoadingStatus;
22 | error?: string;
23 | }
Add @babel/preset-flow (https://github.com/babel/babel/tree/main/packages/babel-preset-flow) to the 'presets' section of your Babel config to enable transformation.
At that point I added the "presets": ["@babel/preset-typescript"]
to all babel.config.json
and then build worked.
I got a little further by creating a
.npmrc
file with the contentlegacy-peer-deps=true
However, then I got
> nx build > nx run studio-ghibli-search-engine-web:build:production > NX Cannot find module '@svgr/webpack' Require stack: - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/react/plugins/with-react.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/react/plugins/webpack.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/apps/studio-ghibli-search-engine-web/webpack.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/utils/webpack/custom-webpack.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/dev-server/dev-server.impl.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/index.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/webpack/lib/get-webpack-config.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/@nrwl/webpack/src/executors/webpack/webpack.impl.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/src/config/workspaces.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/src/command-line/run.js - /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/node_modules/nx/bin/run-executor.js Pass --verbose to see the stacktrace.
To fix this I did
npm i @svgr/webpack
After that build still failed, but now with errors like this
ERROR in ./libs/store/src/lib/films/films.slice.ts Module build failed (from ./node_modules/@nrwl/webpack/src/utils/web-babel-loader.js): SyntaxError: /Users/klas.mellbourn/code/firstvet/visual-regression-testing/studio-ghibli-search-engine/libs/store/src/lib/films/films.slice.ts: Support for the experimental syntax ' flow' isn't currently enabled (20:8): 18 | export const FILMS_FEATURE_KEY = 'films'; 19 | > 20 | export interface FilmsState extends EntityState<FilmEntity> { | ^ 21 | loadingStatus: LoadingStatus; 22 | error?: string; 23 | } Add @babel/preset-flow (https://github.com/babel/babel/tree/main/packages/babel-preset-flow) to the 'presets' section of your Babel config to enable transformation.
At that point I added the
"presets": ["@babel/preset-typescript"]
to allbabel.config.json
and then build worked.
@Mellbourn Thank you for that, it worked great! I'm trying to do the same with the iOS app, but got a symlink error.
> NX EEXIST: file already exists, symlink '/Users/cphanthanh/Documents/studio-ghibli-search-engine/node_modules' -> '/Users/cphanthanh/Documents/studio-ghibli-search-engine/apps/studio-ghibli-search-engine-mobile/node_modules'
I then reran npm install
with --legacy-peer-deps and built, but am now running into an error in what looks like mobile/node_modules/metro/src/node-haste/DependencyGraph.
Have you had any success with the mobile apps?
Yes, this is another bug in the repo:
The apps/studio-ghibli-search-engine-mobile/node_modules
file must be a symbolic link to the node_modules
in the root of the repository. Just erase it
rm apps/studio-ghibli-search-engine-mobile/node_modules
Then it will be recreated correctly during build.
I have a fork where I've fixed these in a branch called loki
. I'm doing others stuff there too, but you can take a look if you want https://github.com/Mellbourn/studio-ghibli-search-engine
@Mellbourn You're a legend :) thank you!
Must be a conflict with later version of react.