Laravel webpack compile error bootstrap variable undefined - node.js

I'm struggling for hours but don't know why I'm getting this on webpack compile command node version 12
ERROR in ./node_modules/css-loader??ref--8-2!./node_modules/postcss-loader/lib??postcss!./node_modules/resolve-url-loader??ref--8-4!./node_modules/sass-loader/lib/loader.js??ref--8-5!./resources/assets/sass/main.scss
Module build failed:
font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
^
Undefined variable: "$font-weight-bolder".
in /www/wwwroot/ship-hero.codersarray.com/node_modules/bootstrap/scss/_reboot.scss (line 158, column 16)
# ./resources/assets/sass/main.scss 4:14-267
# multi ./resources/assets/js/pages/install.js ./resources/assets/sass/main.scss
ERROR in ./resources/assets/sass/main.scss
Module build failed: ModuleBuildError: Module build failed:
font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari
^
Undefined variable: "$font-weight-bolder".
in /www/wwwroot/ship-hero.codersarray.com/node_modules/bootstrap/scss/_reboot.scss (line 158, column 16)
at /www/wwwroot/ship-hero.codersarray.com/node_modules/webpack/lib/NormalModule.js:195:19
at /www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/www/wwwroot/ship-hero.codersarray.com/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.callback (/www/wwwroot/ship-hero.codersarray.com/node_modules/sass-loader/lib/loader.js:55:13)
at Object.done [as callback] (/www/wwwroot/ship-hero.codersarray.com/node_modules/neo-async/async.js:8069:18)
at options.error (/www/wwwroot/ship-hero.codersarray.com/node_modules/node-sass/lib/index.js:294:32)
# ./resources/assets/sass/main.scss
# multi ./resources/assets/js/pages/install.js ./resources/assets/sass/main.scss

I already fixed it here is the solution if anyone encounters the same problem the issue is with the bootstrap version according to package.json bootstrap version is ^4.0.0 but on running npm install 4.6 version is being installed that is causing the issue so I just install the specific version that is 4.0.0 changed the value in the package.json from ^4.0.0 to 4.0.0.

Related

Error in node module while installing the package in dev

ERROR in /node_modules/react-file-viewer/src/app.js Module build failed (from /node_modules/babel-loader/lib/index.js):
SyntaxError: /home/myfiles/myfiles-code/myfiles/frontend/node_modules/react-file-viewer/src/app.js. Support
for the experimental syntax 'jsx' isn't currently enabled (6:3):
ReactDOM.render (Fileviewer/,
document.getElementByld('app')

How to fix Directory import '#angular-devkit\build-angular\src\dev-server' is not supported resolving ES modules after updating Angular to version 13

When running ng serve I get the following error after updating my angular version:
An unhandled exception occurred: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular-devkit\build-angular\src\dev-server' is not supported
resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/#angular-devkit/build-angular/src/dev-server/index.js?
See "C:\Users\xxx\AppData\Local\Temp\ng-TMJqg5\angular-errors.log" for further details.
Log output:
[error] Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular-devkit\build-angular\src\dev-server' is not supported resolving ES modules imported from C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js
Did you mean to import C:/Users/xxx/Documents/desktop-server-client-app/desktop/server/client/node_modules/#angular-devkit/build-angular/src/dev-server/index.js?
at finalizeResolution (internal/modules/esm/resolve.js:272:17)
at moduleResolve (internal/modules/esm/resolve.js:699:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:229:28)
at Loader.import (internal/modules/esm/loader.js:164:28)
at importModuleDynamically (internal/modules/cjs/loader.js:1006:27)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at eval (eval at loadEsmModule (C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:195:12), <anonymous>:3:1)
at loadEsmModule (C:\Users\xxx\Documents\desktop-server-client-app\desktop\server\client\node_modules\#angular\cli\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:195:68)
Could somebody explain to me what this error means and how I could fix it? It seems to me that this is some kind of compatibility problem I can't do much about. My angular project so far just contains some boilerplate code, so it shouldn't be the problem.
Edit: My versions are the following:
Node: 14.15.0
npm: 6.14.8
Angular: 13.2.4
#angular-devkit/architect: 0.1202.16
#angular-devkit/build-angular: 12.2.16
#angular-devkit/core: 12.2.16
#angular-devkit/schematics: 13.2.5
#angular/cdk: 12.2.13
#angular/cli: 13.2.5
#angular/material: 12.2.13
#schematics/angular: 13.2.5
rxjs: 6.6.7
typescript: 4.5.5
I faced this problem because I updated my project to Angular 13 using --legacy-peer-deps flag. Because of that, there were old dependencies still present in package.json.
Make sure you have the appropriate package version regarding the thrown error. In your precise case, try to change
"#angular-devkit/build-angular": "~12.2.16"
to "#angular-devkit/build-angular": "~13.2.5"
then run npm install.

Error with SassError: Undefined function while starting angular app

I am getting error while starting angular app after successful npm install.
It shows below error -
ERROR in ./src/styles.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/dist/cjs.js
??ref--13-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined function.
╷
19 │ $marker-size-third: ceil(math.div($marker-size, 3));
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\progress-tracker\src\styles\progress-tracker_progress-tracker-variables.scss 19:26 #import
node_modules\progress-tracker\src\styles\progress-tracker.scss 1:9
Current package-lock.json has sass and sass-loader version -
"sass": "1.26.3",
"sass-loader": "8.0.2",
The version of sass that you are using do not support the mathematical function div. You are using the version 1.26.3 and that function appeared in the version 1.33.0 as you can see in their documentation.
So in order to fix your issue, you have essentially 2 possibilities.
Bump the sass version if you can (the preferable way).
Use the old (and deprecated, so be aware) / operator.
If you use the option number 2, your code would become this:
$marker-size-third: ceil( $marker-size / 3 );

app:compileDebugJavaWithJavac task failing, erroring out on its own code

I'm getting this error after running npx react-native run-android, and I'm new to react and node in general so I'm not sure what could be going on.
gradle build --warning-mode all runs successfully with no issue. Not sure what could be going on. Running react-native upgrade doesn't help as suggested in similar questions, but it does give the error "Accessing non-existent property 'padLevels' of module exports inside circular dependency", though I think it's unrelated.
I'm on npm 6.14.10, node v14.15.4, Gradle 6.4, react-native-cli 2.0.1, react-native 0.63.4, openjdk 14.0.2
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4/userguide/command_line_interface.html#sec:command_line_warnings
106 actionable tasks: 2 executed, 104 up-to-date
/android/app/src/main/java/com/test/MainApplication.java:20: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
/android/app/src/main/java/com/test/MainApplication.java:59: error: cannot find symbol
if (BuildConfig.DEBUG) {
^
symbol: variable BuildConfig
location: class MainApplication
/android/app/src/main/java/com/test/MainApplication.java:59: error: illegal parenthesized expression
if (BuildConfig.DEBUG) {
^
Note: /android/app/src/debug/java/com/test/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

jhipster 5.4.2 skipping user management error

Upon installing jhipster 5.4.2 (skipping user management):
jhipster --skip-user-management
I get the following error:
ERROR Failed to compile with 1 errors 22:02:12
This relative module was not found:
./user-management in ./src/main/webapp/app/shared/reducers/index.ts
✖ 「wdm」: 971 modules
ERROR in ./src/main/webapp/app/shared/reducers/index.ts
Module not found: Error: Can't resolve './user-management' in '/Users/spasco/code/web/polarisnousers/src/main/webapp/app/shared/reducers'
ℹ 「wdm」: Failed to compile.
Is this a bug or expected behavior?

Resources