Build error:
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
My OS: Windows 10
The error msg is self explanatory.
Here is how I fixed it:
If you are using Windows OS, then first install the cross-env as a dev dependency.(https://github.com/kentcdodds/cross-env).
Then update your build command in package.json as follows:
Ex: For a project using Create React App;
"build": "cross-env CI=false react-scripts build"
Done!
Related
`npm start is working fine but npm run build is creating issue.
I have changed typescript, esline and react scripts versions but didn't get any success.`
How can I solve this warning when creating laravel project?
1 WARNING in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
Steps to replicate:
composer create-project --prefer-dist laravel/laravel example
cd example
composer require laravel/ui
php artisan ui vue --auth
npm install vue#next vue-router#next vue-loader#next
npm install
npm run dev
EDIT
From this solution, add these lines to webpack.mix.js
mix.webpackConfig({
stats: {
children: true,
},
});
The above solution creates another warning:
WARNING in ./resources/sass/app.scss (./node_modules/css-loader/dist/cjs.js??clonedRuleSet-6.use1!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-6.use[2]!./node_modules/resolve-url-loader/index.js??clonedRuleSet-6.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-6.use[4]!./resources/sass/app.scss)
Module Warning (from ./node_modules/postcss-loader/dist/cjs.js):
Warning
(2423:3) autoprefixer: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
Child mini-css-extract-plugin C:\xampp\htdocs\lva\node_modules\css-loader\dist\cjs.js??clonedRuleSet-6.use1!C:\xampp\htdocs\lva\node_modules\postcss-loader\dist\cjs.js??clonedRuleSet-6.use[2]!C:\xampp\htdocs\lva\node_modules\resolve-url-loader\index.js??clonedRuleSet-6.use[3]!C:\xampp\htdocs\lva\node_modules\sass-loader\dist\cjs.js??clonedRuleSet-6.use[4]!C:\xampp\htdocs\lva\resources\sass\app.scss compiled with 1 warning
webpack compiled with 1 warning
How can I solve this?
The color-adjust shorthand is currently deprecated and it depends on the autoprefixer#10.4.6 (source).
I was able to fix this by reverting the autoprefixer package as well as #Benno to version 10.4.5. Run this:
npm install autoprefixer#10.4.5 --save-exact
You probably updated your npm packages. I was able to fix this by reverting the autoprefixer package to version 10.4.5 in the package-lock.json.
when you have problem with autoprefixer maybe because your version autoprefixer. you can add version autoprefixer based problem this version autoprefixer . i have problem on "print-color-adjust" and i add code on my package.json for change my autoprefixer become version "10.4.5"
when you use npm
"overrides": {
"autoprefixer": "10.4.5"
},
Or, when you use yarn
"resolutions": {
"autoprefixer": "10.4.5"
},
Don't forget to delete your package-lock and node_modules , then npm install again.
it work for me (react-bootstrap.v.5)
If you don't want to add additional packages to solve this error, then try this:
Capitalize all the files and Directory name in your components folder
Or you can run this command to install a package if the above solution doesn't work.
npm install autoprefixer#10.4.5 --save-exact
I'm using React with InertiaJS and Laravel as backend, this solution worked in my case.
Thanks
I have the same problem, whenever I hit save an annoying pop-up of error code comes. The simple solution is to add the following code to your webpack.mixjs file :
mix.webpackConfig({
stats: {
children: true,
},});
stop the npm run watch
add a package autoprefixer, add below in terminal:
npm install autoprefixer#10.4.5 --save-exact
run npm run watch and it will not give the error again.
I solved this issue within Laravel by changing the file ./node_modules/bootstrap/scss/forms/_form-check.scss
Line 28 part of the .form-check-input style
change color-adjust: exact; // Keep themed appearance for print
to print-color-adjust: exact; // Keep themed appearance for print
The Laravel Vite Doc sais to run:
npx apply laravel:vite --ignore-existing
inside your project root to install vite in your laravel project.
When I try to do that in a freshly installed laravel project it shows this:
zsh:1: command not found: laravel:vite
What am I doing wrong?
Using Macos Big Sur with PhpStorm.
That command no longer applies to newly created projects (as of laravel-vite 0.1.27, released a few days ago), and it now results in a different error:
$ npx apply laravel:vite --ignore-existing
[ info ] Applying preset laravel:vite.
[ error ] The preset could not be evaluated.
evalmachine.<anonymous>:13
var preset_default = definePreset({
^
ReferenceError: definePreset is not defined
at evalmachine.<anonymous>:13:22
at Script.runInContext (node:vm:139:12)
at Object.runInContext (node:vm:289:6)
at ModuleImporter.evaluateConfiguration (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:68:26)
at ModuleImporter.import (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Importer/ModuleImporter.js:17:27)
at PresetApplier.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/Applier/PresetApplier.js:22:87)
at async CommandLineInterface.apply (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:57:16)
at async CommandLineInterface.run (/Users/tony/src/laravel-vite-demo/example-app/node_modules/apply/dist/IO/CommandLineInterface.js:54:16)
However, the command shown in the laravel-presets/vite repository (the source repo for the laravel:vite preset) worked for me -- i.e., it augmented the Laravel project with Vite:
# Run this command from root of Laravel project
npx #preset/cli apply --debug laravel:vite
#preset/cli currently suppresses all output (including errors), so the --debug flag above is important. Since the verbose log is difficult to follow, I recommend redirecting the output to a file, and searching it for the word exception.
Tips
To ensure the preset succeeds, you must have php#8.0 (e.g., from Homebrew) and composer installed and available from the command line. Add the paths to those binaries to your PATH environment variable.
The Vite server must be started separately from the PHP server. Run npm run dev in one terminal; and php artisan serve from another.
Vite is now the default frontend asset bundler in laravel which replaces webpack. No additional installations are needed for new projects.
https://laravel-news.com/vite-is-the-default-frontend-asset-bundler-for-laravel-applications
I am facing issue while using the following command
npm run production
after execute following command i see following error
ERROR Failed to compile with 5 errors
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'map' of undefined
at preparePluginsArray (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:64:20)
at module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:32:28)
at new module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo.js:21:19)
at E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\dist\index.js:95:16
at Object.creator [as postcssSvgo] (E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\node_modules\postcss\lib\postcss.js:150:35)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:295:40
at Array.forEach (<anonymous>)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:282:29
at creator (E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\node_modules\postcss\lib\postcss.js:150:35)
at processCss (E:\wamp\www\smm.yasmalik.com\node_modules\css-loader\lib\processCss.js:199:16)
It was issue with my node_modules folder. there were some extra useless packages so simply i just deleted node_modules and install it again with following commands
Step 1
Delete node_modules manually
Step 2
Install the node_modules folder again:
npm i
Step 3
Update existing packages
npm update
That's it!
Probably you have some conflicts with versions of some npm packages.
Try to reinstall npm:
rm -rf node_modules
npm install
I am running a build on Xcode for my React Native project and for some reason, when running the build in debug mode, this error appears:
'TransformError: [my directory] : Unknown plugin "module-resolver" ' inside my babelrc file.
I tried to npm install the module-resolver to see if that would get rid of the error however the simulator still has as red screen with that same TransformError.
Any help/guidance on this would be really helpful.
Thanks
You must install the 'babel-plugin-module-resolver'.
You should run:
npm install babel-plugin-module-resolver --save-dev
https://www.npmjs.com/package/babel-plugin-module-resolver