next js error build : next build not working because error css - next.js

Hello I try to build my project but it gives me errors.I am being told precisely about a webpack error
adgroupe#0.1.0 build C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe
next build
info - Checking validity of types
info - Creating an optimized production build
Failed to compile.
HookWebpackError: C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\static\css\93f817412a0f74ff.css:801:13: Unknown word
at makeWebpackError (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\compiled\webpack\bundle5.js:41664:9)
at C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\compiled\webpack\bundle5.js:25354:12
at eval (eval at create (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\compiled\webpack\bundle5.js:140346:10), :34:1)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:95:5)
-- inner error --
CssSyntaxError: C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\static\css\93f817412a0f74ff.css:801:13: Unknown word
at Input.error (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\input.js:148:16)
at ScssParser.unknownWord (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:522:22)
at ScssParser.other (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:149:12)
at ScssParser.parse (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:59:16)
at scssParse (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:322)
at new LazyResult (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\lazy-result.js:133:16)
at Processor.process (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\processor.js:28:14)
at CssMinimizerPlugin.optimizeAsset (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\build\webpack\plugins\css-minimizer-plugin.js:43:12)
at C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\build\webpack\plugins\css-minimizer-plugin.js:77:55
at runMicrotasks ()
caused by plugins in Compilation.hooks.processAssets
CssSyntaxError: C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\static\css\93f817412a0f74ff.css:801:13: Unknown word
at Input.error (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\input.js:148:16)
at ScssParser.unknownWord (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:522:22)
at ScssParser.other (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:149:12)
at ScssParser.parse (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\parser.js:59:16)
at scssParse (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\compiled\postcss-scss\scss-syntax.js:1:322)
at new LazyResult (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\lazy-result.js:133:16)
at Processor.process (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\node_modules\postcss\lib\processor.js:28:14)
at CssMinimizerPlugin.optimizeAsset (C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\build\webpack\plugins\css-minimizer-plugin.js:43:12)
at C:\Users\alain\Documents\PROJECTS\ADGROUPE\adgroupe\node_modules\next\dist\build\webpack\plugins\css-minimizer-plugin.js:77:55
at runMicrotasks ()
Build failed because of webpack errors
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adgroupe#0.1.0 build: next build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the adgroupe#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alan\AppData\Roaming\npm-cache_logs\2022-04-03T09_05_40_524Z-debug.log

Related

Next JS deployment fail on Amazon Amplify ERR

I am trying to deploy an SSG app on Next JS but it's failing again and again I am getting an error of build failed. I have followed the documentation for deploying an SSG site on amazon but still, I am getting errors I don't know what's wrong.
Below is the log of my amplify app:
en
# Starting phase: preBuild
# Executing command: npm ci
2022-10-19T06:14:55.093Z [WARNING]: npm
2022-10-19T06:14:55.095Z [WARNING]: ERR! caniuse-lite not accessible from browserslist
2022-10-19T06:14:55.129Z [WARNING]:
2022-10-19T06:14:55.129Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-10-19T06_14_55_093Z-debug.log
2022-10-19T06:14:55.129Z [HELP]: Outputting the npm debug log
[object Promise]
2022-10-19T06:14:55.135Z [ERROR]: !!! Build failed
2022-10-19T06:14:55.135Z [ERROR]: !!! Non-Zero Exit Code detected
2022-10-19T06:14:55.135Z [INFO]: # Starting environment caching...
2022-10-19T06:14:55.137Z [INFO]: # Environment caching completed
Terminating logging...

Error returning when executing the firebase deploy command. I tried some configuration options, but not worked

=== Deploying to '###'...
i deploying functions
Running command: npm --prefix "%RESOURCE_DIR%" run lint
functions# lint C:\usCloud\functions
tslint --project tsconfig.json
WARNING: C:/usCloud/functions/src/index.ts:13:10 - bodyParser is deprecated.
WARNING: C:/usCloud/functions/src/index.ts:14:10 - bodyParser is deprecated.
Running command: npm --prefix "%RESOURCE_DIR%" run build
functions# build C:\usCloud\functions
tsc
node_modules/#google-cloud/firestore/types/firestore.d.ts:23:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DocumentData, UpdateData, Firestore, GeoPoint, Transaction, WriteBatch, WriteResult, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, OrderByDirection, WhereFilterOp, Query, QuerySnapshot, DocumentChangeType, CollectionReference, FieldValue, FieldPath, Timestamp, v1beta1, v1, OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, DATA_LOSS, UNAUTHENTICATED, FirebaseFirestore
23 declare namespace FirebaseFirestore {
node_modules/firebase-functions-helper/node_modules/#google-cloud/firestore/types/firestore.d.ts:25:1
25 declare namespace FirebaseFirestore {
~~~~~~~
Conflicts are in this file.
node_modules/firebase-functions-helper/node_modules/#google-cloud/firestore/types/firestore.d.ts:25:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: DocumentData, UpdateData, Firestore, GeoPoint, Transaction, WriteBatch, WriteResult, DocumentReference, DocumentSnapshot, QueryDocumentSnapshot, OrderByDirection, WhereFilterOp, Query, QuerySnapshot, DocumentChangeType, CollectionReference, FieldValue, FieldPath, Timestamp, v1beta1, v1, OK, CANCELLED, UNKNOWN, INVALID_ARGUMENT, DEADLINE_EXCEEDED, NOT_FOUND, ALREADY_EXISTS, PERMISSION_DENIED, RESOURCE_EXHAUSTED, FAILED_PRECONDITION, ABORTED, OUT_OF_RANGE, UNIMPLEMENTED, INTERNAL, UNAVAILABLE, DATA_LOSS, UNAUTHENTICATED, FirebaseFirestore
25 declare namespace FirebaseFirestore {
node_modules/#google-cloud/firestore/types/firestore.d.ts:23:1
23 declare namespace FirebaseFirestore {
~~~~~~~
Conflicts are in this file.
node_modules/firebase-functions-helper/node_modules/#google-cloud/firestore/types/firestore.d.ts:168:5 - error TS2374: Duplicate string index signature.
168 [key: string]: any; // Accept other properties, such as GRPC settings.
~~~~~~~~~~~~~~~~~~~
Found 3 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions# build: tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions# build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users##\AppData\Roaming\npm-cache_logs\2020-08-26T16_49_58_562Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2

Can I build my Next Js project inside cpanel

I need to build my next js project inside the cpanel so I dont have to build it locally and upload it every time.
I tried running the build script in the cpanel using the "setup Node.js app" and this is the error I get :
client#0.1.0 build /home/bazztn/front
next build
info - Using webpack 5. Reason: Enabled by default
https://nextjs.org/docs/messages/webpack5 info - Checking validity of
types... stderr: events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn /opt/alt/alt-nodejs14/root/usr/bin/node EAGAIN
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) Emitted 'error' event on
ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) { errno: -11, code:
'EAGAIN', syscall: 'spawn /opt/alt/alt-nodejs14/root/usr/bin/node',
path: '/opt/alt/alt-nodejs14/root/usr/bin/node', spawnargs: [
'/home/bazztn/nodevenv/front/14/lib/node_modules/jest-worker/build/workers/processChild.js'
] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! client#0.1.0
build: next build npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the client#0.1.0 build script. npm ERR! This is probably not a
problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
/home/bazztn/.npm/_logs/2022-04-10T16_24_44_597Z-debug.log
You should be fully able to do so. I am personally hosting a Nuxt and Next projects on a cPanel host without none issues so far.
The easiest way to deploy any NodeJS app is to use CloudLinux's NodeJS Selector and the good part of it is that you can also choose which Node version to be used for your app (no matter the server's default node version or whatsoever).
Having that said, I would highly recommend you just find a cPanel host which does come with the NodeJS feature.

spring cloud contract docker not publishing to artifactory

Following the steps described here, I ran
1. git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
2. cd spring-cloud-contract-nodejs
3. npm install
4. npm test
Build is successful, however I don't see the artifacts getting published to artifcatory.
ubuntu#ip-172-31-2-26:~/spring-cloud-contract-nodejs$ git status On branch sc-contract Your branch is up to date with 'origin/sc-contract'.
nothing to commit, working tree clean ubuntu#ip-172-31-2-26:~/spring-cloud-contract-nodejs$ npm install
up to date in 24s
14 packages are looking for funding run `npm fund` for details ubuntu#ip-172-31-2-26:~/spring-cloud-contract-nodejs$ npm test
> bookstore#1.0.0 test
> ./run_tests.sh
Running tests against Artifactory
~/spring-cloud-contract-nodejs/docker ~/spring-cloud-contract-nodejs Killing docker_artifactory_1 ... done Killing docker_mongo_1 ... done ~/spring-cloud-contract-nodejs Fetching submodules Entering 'spring-cloud-contract-nodejs-external-contracts' fatal: couldn't find remote ref master fatal: run_command returned non-zero status for spring-cloud-contract-nodejs-external-contracts . Building docker ~/spring-cloud-contract-nodejs/docker ~/spring-cloud-contract-nodejs Going to remove docker_artifactory_1, docker_mongo_1 Removing docker_artifactory_1 ... done Removing docker_mongo_1 ... done mongo uses an image, skipping Building artifactory Sending build context to Docker daemon 7.68kB Step 1/4 : FROM docker.bintray.io/jfrog/artifactory-oss:5.5.1 ---> add606aca80a Step 2/4 : MAINTAINER Marcin Grzejszczak <mgrzejszczak#pivotal.io> ---> Using cache ---> cbb8dd3f2cff Step 3/4 : COPY artifactory.config.import.yml /var/opt/jfrog/artifactory/etc/artifactory.config.import.yml ---> Using cache ---> 46f1452932fd Step 4/4 : ENTRYPOINT ["/bin/sh", "-c", "/entrypoint-artifactory.sh"] ---> Using cache ---> c8261b8fe68c Successfully built c8261b8fe68c Successfully tagged docker_artifactory:latest Creating docker_artifactory_1 ... done Creating docker_mongo_1 ... done ~/spring-cloud-contract-nodejs Waiting for 30 seconds for artifactory to boot properly Failed to kill app Working around certificate issues npm WARN npm npm does not support Node.js v17.2.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9, 10. npm WARN npm You can find the latest version at https://nodejs.org/ npm WARN npm npm does not support Node.js v17.2.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9, 10. npm WARN npm You can find the latest version at https://nodejs.org/ npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in: npm ERR! /home/ubuntu/.npm/_logs/2021-12-16T20_30_09_497Z-debug.log Failed to install packages npm WARN npm npm does not support Node.js v17.2.0 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9, 10. npm WARN npm You can find the latest version at https://nodejs.org/ npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in: npm ERR! /home/ubuntu/.npm/_logs/2021-12-16T20_30_09_937Z-debug.log Failed to install package nohup: appending output to 'nohup.out' Sc Contract Version [3.1.0] Application URL [http://172.18.0.1:9876] Artifactory URL [http://172.18.0.1:8081/artifactory/libs-release-local] Project Version [0.0.1.RELEASE] Setting project name to [bookstore] Running the build To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.3/userguide/gradle_daemon.html#sec:disabling_the_daemon. Daemon will be stopped at the end of the build
> Task :buildSrc:compileJava UP-TO-DATE
> Task :buildSrc:compileGroovy NO-SOURCE
> Task :buildSrc:processResources NO-SOURCE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
> Task :buildSrc:test NO-SOURCE
> Task :buildSrc:check UP-TO-DATE
> Task :buildSrc:build UP-TO-DATE
> Configure project : Will use contracts from the mounted [/contracts] folder
> Task :clean UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :compileGroovy NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :bootJarMainClassName
> Task :bootJar SKIPPED
> Task :jar
> Task :copyContracts
> Task :generateClientStubs
> Task :verifierStubsJar
> Task :assemble
> Task :compileTestJava
> Task :compileTestGroovy NO-SOURCE
> Task :processTestResources
> Task :testClasses
> Task :test
> Task :generateContractTests
> Task :compileContractTestJava Note: /spring-cloud-contract/build/generated-test-sources/contractTest/java/contracts/ContractVerifierTest.java uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details.
> Task :compileContractTestGroovy NO-SOURCE
> Task :processContractTestResources NO-SOURCE
> Task :contractTestClasses
> Task :contractTest 2021-12-16 20:31:43.487 INFO 136 --- [ionShutdownHook] o.a.c.impl.engine.AbstractCamelContext : Apache Camel 3.11.0 (camel-1) shutting down (timeout:45s) 2021-12-16 20:31:43.495 INFO 136 --- [ionShutdownHook] o.a.c.impl.engine.AbstractCamelContext : Routes shutdown summary (total:0 stopped:0) 2021-12-16 20:31:43.498 INFO 136 --- [ionShutdownHook] o.a.c.impl.engine.AbstractCamelContext : Apache Camel 3.11.0 (camel-1) shutdown in 11ms (uptime:1s480ms) Results: (2 tests, 2 successes, 0 failures, 0 skipped)
> Task :cleanOutput UP-TO-DATE
> Task :copyOutput Execution optimizations have been disabled for task ':copyOutput' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':bootJarMainClassName' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':compileContractTestGroovy' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':compileContractTestJava' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':contractTest' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':copyContracts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':generateClientStubs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':generateContractTests' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':jar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':processContractTestResources' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/spring-cloud-contract/build'. Reason: Task ':copyOutput' uses this output of task ':verifierStubsJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :check
> Task :build
> Task :publishToMavenLocal SKIPPED
> Task :publish UP-TO-DATE
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details.
BUILD SUCCESSFUL in 1m 33s 16 actionable tasks: 12 executed, 4 up-to-date

Error canonicalCode: INVALID_ARGUMENT, "errorMessage": "`npm_install` had stderr output while firebase deploy

I'm deploying my nodeJS code with firebase, If I do firebase serve on local machine it works fine, but when I do firebase deploy it gives me multiple errors.
{"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "npm_install had stderr output.....}}
if i resolve this issue then i get.
gen_package_lock` had stderr output.
I am not able to deploy firebase.
I am using node version >12 and integrated firebase with that. Stuck on this,
Tried with removing package-lock.json as well.
ERROR:-
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "npm_install had stderr output:\nnpm ERR! cb() never called!\n\nnpm ERR! This is an error with npm itself. Please report this error at:\nnpm ERR! https://npm.community\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2019-12-13T07_06_14_773Z-debug.log\n\nerror: npm_install returned code: 1", "errorType": "InternalError", "errorId": "8042D85F"}}
Expecting some solutions to resolve this issue.
Thanks

Resources