Html Webpack Plugin: Child Compilation Failed error in React page - node.js

I'm new to React, and I'm following a tutorial, and after a 'yarn start' command, I go to 'localhost:3000' and see this error appear:
Error: Child compilation failed:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\glob al.js: Cannot find module './src/data'
It's the first step of the tutorial that has anything to do with React at all, so I don't see where could I have gone wrong, any ideas on what the problem might be would be very useful.
The full error is this:
Error: Child compilation failed:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\glob al.js: Cannot find module './src/data'
Require stack:
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list-f or-target-version.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_modul es\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_modul es\#babel\preset-env\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependenci es.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\plug ins.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\inde x.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner.js - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory.j s
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\webpack.js
- C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\react-scripts\scripts\start.js (W hile processing: "C:\\Users\\Iván\\PycharmProjects\\django_react\\django-todo-react\\frontend\\node_modules\\babel-pre set-react-app\\dependencies.js$0$9")
- loader.js:797 Function.Module._resolveFilename
internal/modules/cjs/loader.js:797:15
- loader.js:690 Function.Module._load
internal/modules/cjs/loader.js:690:27
- loader.js:852 Module.require
internal/modules/cjs/loader.js:852:19
- helpers.js:74 require
internal/modules/cjs/helpers.js:74:18
- helpers.js:3 Object.
[frontend]/[core-js-compat]/helpers.js:3:14
- loader.js:959 Module._compile
internal/modules/cjs/loader.js:959:30
- loader.js:995 Object.Module._extensions..js
internal/modules/cjs/loader.js:995:10
- loader.js:815 Module.load
internal/modules/cjs/loader.js:815:32
- loader.js:727 Function.Module._load
internal/modules/cjs/loader.js:727:14
- loader.js:852 Module.require
internal/modules/cjs/loader.js:852:19
- helpers.js:74 require
internal/modules/cjs/helpers.js:74:18
- get-modules-list-for-target-version.js:2 Object.
[frontend]/[core-js-compat]/get-modules-list-for-target-version.js:2:51
- loader.js:959 Module._compile
internal/modules/cjs/loader.js:959:30
- loader.js:995 Object.Module._extensions..js
internal/modules/cjs/loader.js:995:10
- loader.js:815 Module.load
internal/modules/cjs/loader.js:815:32
- Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\gl obal.js: Cannot find module './src/data'
- Require stack:
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list -for-target-version.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependen cies.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\pl ugins.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\in dex.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner. js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory .js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\webpack.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\react-scripts\scripts\start.js (While processing: "C:\\Users\\Iván\\PycharmProjects\\django_react\\django-todo-react\\frontend\\node_modules\\babel -preset-react-app\\dependencies.js$0$9")
- Module build failed (from ./node_modules/babel-loader/lib/index.js):
- Error: [BABEL] C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\buildin\mo dule.js: Cannot find module './src/data'
- Require stack:
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\helpers.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\core-js-compat\get-modules-list -for-target-version.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\polyfills\corejs3\entry-plugin.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\node_mod ules\#babel\preset-env\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-preset-react-app\dependen cies.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\pl ugins.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\config\files\in dex.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\#babel\core\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\babel-loader\lib\index.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\loadLoader.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\loader-runner\lib\LoaderRunner. js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModule.js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\NormalModuleFactory .js
- - C:\Users\Iván\PycharmProjects\django_react\django-todo-react\frontend\node_modules\webpack\lib\Compiler.js
I see three errors in total, all saying "Cannot find module './src/data'", so I guess there's that missing? In my project directory, I don't see anything called 'data' in the 'src' folder. Why could that be, or what should I add to fix it?

I think there is a bug in the core-js-combat version 3.4.6. This nasty bug is already fixed in version 3.4.7. So you can run npm install core-js-compat#3.4.7 --save .

temporary fix until the core-js-compat makes its way through all the repos:
npm i -s core-js-compat#3.4.7
Apparently this is related to a bad build of core-js-compat, which is a deep dependency of babel. These two posts have more information:
Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module './src/data'
I am getting an error of Html Webpack Plugin in reactjs

This is working for me you can also try this
npm install core-js-compat#3.4.7 --save

Related

Error while deploying React App on Vercel

I tried deploying my React App on Vercel but i get those error messages:
The cli flag --force was set. Skipping build cache download.
Cloning completed: 687.734ms
Running "vercel build"
Vercel CLI 28.4.17
Installing dependencies...
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://git#github.com/ethereumjs/ethereumjs-abi.git
Directory: /vercel/path0
Output:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn run v1.22.17
$ next build
info - Loaded env from /vercel/path0/.env
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
info - Linting and checking validity of types...
error - ESLint must be installed in order to run during builds: yarn add --dev eslint
info - Creating an optimized production build...
info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
info - Using external babel configuration from /vercel/path0/.babelrc
Failed to compile.
../../usr/local/share/.config/yarn/global/node_modules/next/dist/pages/_document.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
../../usr/local/share/.config/yarn/global/node_modules/next/dist/pages/_error.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/_app.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/index.js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
./pages/product/[slug].js
Error: Cannot find module '#babel/preset-react'
Require stack:
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/core.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/version.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/telemetry/events/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/verifyAndLint.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/build/index.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/cli/next-build.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/lib/commands.js
- /usr/local/share/.config/yarn/global/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.mod._resolveFilename (/usr/local/share/.config/yarn/global/node_modules/next/dist/build/webpack/require-hook.js:23:32)
at resolve (node:internal/modules/cjs/helpers:109:19)
at tryRequireResolve (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:41863)
at resolveStandardizedNameForRequire (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:42364)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:43011)
at sync (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:716601)
at /usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1910:717013
at Generator.next (<anonymous>)
at resolvePreset (/usr/local/share/.config/yarn/global/node_modules/next/dist/compiled/babel/bundle.js:1:40447)
> Build failed because of webpack errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
I can't deploy on Vercel, any tip on how to fix that?
Thanks in advance.
I'll also leave a link to a video including the full Vercel log with errors highlighted in red: https://www.veed.io/view/218cb302-0a04-406f-84a9-7b5d353a2ffa?sharingWidget=true&panel=share
I tried building and launching the React App on Visual Studio with "yarn run dev" and "yarn run build" and everything works fine, proglems appear while trying to deploy it on Vercel.

Module not found error after trying to execute again after closing the execution

The 1st time i executed my file i got the connection with mongo perfectly. But after i closed all tabs and tried exectuting the same again , couldnt connect to mongo and got the following error always.
npx ts-node src/server.ts
node:internal/modules/cjs/loader:988
throw err;
^
Error: Cannot find module './server.ts'
Require stack:
- C:\Users\sup\Desktop\nm\server\src\src\imaginaryUncacheableRequireResolveScript
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
at Function.resolve (node:internal/modules/cjs/helpers:109:19)
at requireResolveNonCached (

'npm install' gets stuck and eventually 'Killed' at something called 'swc...' on Ubuntu 20.04

Okay so I have been trying to deploy a Next app to my Ubuntu 20.04 vps but I am unable to do so. I have uploaded all the files from my local machine to the server via ftp and then after trying to install it gets stuck and then killed ( please check the image to see where it gets stuck ). The app works perfectly in my local machine.
I tried by deleting .next directory, node_modules directory as well as package-lock.json file but the problem prevails.
Here's the Node and NPM version in my local machine:
Node: v14.15.0
NPM: v7.14.0
This is the Node and NPM version in my server:
Node: v14.18.2
NPM: v8.3.0
I have also attached my package.json file incase you want to see the dependencies
UPDATE
I some how installed the dependencies but now I am getting different type of errors when I run 'npm run dev' or 'npm run build'.
Here's what I get after I run npm run dev:
[20:09] [server1.example.com boomboom] # npm run dev
> boomboom#0.1.0 dev
> next dev
warn - Port 3000 is in use, trying 3001 instead.
ready - started server on 0.0.0.0:3001, url: http://localhost:3001
info - Loaded env from /home/user1/node-apps/boomboom/.env.local
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[4].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[4].use[2]!./styles/Footer.module.css
/home/user1/node-apps/boomboom/node_modules/source-map/lib/util.js:101
// above the root is a no-op. Therefore we can remove all '.
SyntaxError: Unexpected end of input
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: SyntaxError: /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json (directory description file): SyntaxError: Unexpected end of JSON input
<w> while resolving 'whatwg-url' in /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url to a directory
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: SyntaxError: /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json (directory description file): SyntaxError: Unexpected end of JSON input
<w> while resolving 'whatwg-url' in /home/user1/node-apps/boomboom/node_modules/mongodb-connection-string-url to a directory
This is what I get after I run npm run build:
[20:13] [server1.example.com boomboom] # npm run build
> boomboom#0.1.0 build
> next build
info - Loaded env from /home/user1/node-apps/boomboom/.env.local
info - Checking validity of types
error - ESLint: Failed to load plugin 'react' declared in '.eslintrc.json » eslint-config-next/core-web-vitals » /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js': Cannot find module 'eslint-plugin-react' Require stack: - /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js Referenced from: /home/user1/node-apps/boomboom/node_modules/eslint-config-next/index.js
> Build error occurred
/home/user1/node-apps/boomboom/node_modules/source-map/lib/util.js:101
// above the root is a no-op. Therefore we can remove all '.
SyntaxError: Unexpected end of input
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/home/user1/node-apps/boomboom/node_modules/source-map/lib/source-map-generator.js:9:12)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
info - Creating an optimized production build .[20:13] [server1.example.com boomboom] #

ember-cordova - Invalid or unexpected token on __dirname

I'm trying to build Android app using my Ember frontend and Cordova.
I've configured project as described in ember-cordova docs (changed rootURL and locationType),
I installed ember-cordova via ember install ember-cordova,
Changed app name and widget id in cordova/config.xml,
Added required platform - ember cdv:platform add android,
And I'm trying to build first version of my app using ember cdv:build --platform=android --environment=production.
Unfortunatelly, build fails with error:
EmberCordovaError: Invalid or unexpected token
Stack Trace and Error Report: /tmp/error.dump.0bfefb855ac286c6b6600c600e92d126.log
It happens both on Ubuntu 21.10 and macOS Monterey. I'm using node v12.22.7 installed via node version manager (tried using node from apt packages on Ubuntu, but it didn't help), ember-cordova v1.0.9, and ember v3.12.1.
Full error log:
=================================================================================
ENV Summary:
TIME: Fri Dec 03 2021 12:37:28 GMT+0100 (GMT+01:00)
TITLE: ember
ARGV:
- /home/tomasz/.nvm/versions/node/v12.22.7/bin/node
- /home/tomasz/.nvm/versions/node/v12.22.7/bin/ember
- cdv:build
- --platform=android
- --environment=production
EXEC_PATH: /home/tomasz/.nvm/versions/node/v12.22.7/bin/node
TMPDIR: /tmp
SHELL: /bin/bash
PATH:
- /home/tomasz/.rvm/gems/ruby-3.0.3/bin
- /home/tomasz/.rvm/gems/ruby-3.0.3#global/bin
- /home/tomasz/.rvm/rubies/ruby-3.0.3/bin
- /home/tomasz/.rvm/bin
- /home/tomasz/.local/bin
- /home/tomasz/bin
- /home/tomasz/.nvm/versions/node/v12.22.7/bin
- /home/tomasz/.local/bin
- /home/tomasz/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- /home/tomasz/.rvm/bin
PLATFORM: linux x64
FREEMEM: 18971971584
TOTALMEM: 33553645568
UPTIME: 4862
LOADAVG: 6.15,4.98,3.74
CPUS:
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3505
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3565
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3800
- Intel(R) Core(TM) i5-4670 CPU # 3.40GHz - 3800
ENDIANNESS: LE
VERSIONS:
- ares: 1.17.2
- brotli: 1.0.9
- cldr: 37.0
- http_parser: 2.9.4
- icu: 67.1
- llhttp: 2.1.4
- modules: 72
- napi: 8
- nghttp2: 1.41.0
- node: 12.22.7
- openssl: 1.1.1l
- tz: 2019c
- unicode: 13.0
- uv: 1.40.0
- v8: 7.8.279.23-node.56
- zlib: 1.2.11
ERROR Summary:
- broccoliBuilderErrorStack: [undefined]
- code: [undefined]
- codeFrame: [undefined]
- errorMessage: EmberCordovaError: Invalid or unexpected token
- errorType: [undefined]
- location:
- column: [undefined]
- file: [undefined]
- line: [undefined]
- message: EmberCordovaError: Invalid or unexpected token
- name: EmberCordovaError
- nodeAnnotation: [undefined]
- nodeName: [undefined]
- originalErrorMessage: [undefined]
- stack: (function (exports, require, module, __filename, __dirname) { #!/usr/bin/env node
^
SyntaxError: Invalid or unexpected token
at new Script (vm.js:88:7)
at createScript (vm.js:261:10)
at Object.runInThisContext (vm.js:309:10)
at wrapSafe (internal/modules/cjs/loader.js:902:15)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Api.getPlatformInfo (/home/tomasz/Projects/app-ember/ember-cordova/cordova/platforms/android/cordova/Api.js:174:22)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/src/cordova/prepare.js:53:67
at Array.map (<anonymous>:null:null)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/src/cordova/prepare.js:51:43
at _fulfilled (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:787:54)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:816:30
at Promise.promise.promiseDispatch (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:749:13)
at /home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:557:44
at flush (/home/tomasz/Projects/app-ember/node_modules/cordova-lib/node_modules/q/q.js:108:17)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
=================================================================================
What could be a reason of such a failure?

Angular2 Server Side Rendering - Angular 2 Universal Issue

I tried changing my angular2 app to angular2 universal. On that I segregated server and client side module. On doing npm start I am getting the following error.
EXCEPTION: The selector "app-root" did not match any elements
ORIGINAL STACKTRACE:
Error: The selector "app-root" did not match any elements
at DomRenderer.selectRootElement (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:26663:23)
at selectOrCreateRenderHostElement (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:15131:32)
at AppView._View_AppComponent_Host0.createInternal (/AppModule/AppComponent/host.ngfactory.js:12:16)
at AppView.create (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:51125:21)
at ComponentFactory.create (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:36104:36)
at ApplicationRef_.bootstrap (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22794:40)
at C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22703:89
at Array.forEach (native)
at PlatformRef_._moduleDoBootstrap (C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22703:42)
at C:\Users\SYS168\scotchiversal - Copy\dist\server\index.js:22671:27
Can you please somebody help me out.
This is my folder structure https://s11.postimg.org/g5xht8k6b/git.png
My folder structure

Resources