vue-cli-service build fails with 0 errors - vue.js

Is there a way to track down this kind of build problem? I.e. a flag that would show more detailed error information? My project is very much like the default vue cli project. It has been working fine for months until this morning.
$ vue-cli-service build --mode dev
⠏ Building for dev...
ERROR Failed to compile with 0 errors 12:06:07 PM
ERROR Build failed with errors.
error Command failed with exit code 1.

In this case, I had a file called worker.js which is a web worker being loaded by worker-loader. In worker.js I import a second .js file which imports a missing .js file (due to my error). For whatever reason, this error doesn't make it to the surface of vue-cli-service build.

Related

Why am I getting 'Cannot GET' in localhost for Vue npm run serve

I installed Vite build tool for Vue and when I ran it (npm run serve), I got an error that generated the following message
"Missing script: "serve"".
After a little research, I learned that my package.json was missing the serve key.
After I added it ("serve": "vite preview") and ran it, I received the following error in the browser
"Cannot GET /"
preview is for when your app is already built (with npm run build), it's to check the static result. At the end, serve is the name that was used with Vue2's CLI for preview.
If you want to work locally with it, simply run npm run dev.
More info available on Vite's documentation.

React Native run-android on Apple M1 chip throwing error, "Could not open dsl generic class cache for script"

I am building a mobile application using React-Native. I am now trying to run my application on Android Emulator. First, this is the continuation of this question. I installed the Android Studio and configured the environment as I mentioned in the previous question.
This is what I did to fix the error from previous question.
I changed the line 13 in android/gradle.properties to this:
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
When I run "react-native run-android" command this time, I am getting the error. The error is saying it could not find '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' file.
So I run npm i #react-native-community/cli-platform-android command to install the required package.
The I delete node_modules folder and run "npm install" again. Then I run "react-native run-android". I am getting the following error this time.
* Where:
Settings file '/Users/waihein/Desktop/Code/shar-kya-mal-app/android/settings.gradle' line: 8
* What went wrong:
A problem occurred evaluating settings 'sharkyamalapp'.
> Could not open dsl generic class cache for script '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' (/Users/waihein/.gradle/caches/6.8/scripts/a43tr593rdpk11ispliu0nu14).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
But the file is there I can see it in the node_modules folder. How can I fix it?

`need an appropriate loader` error after running `next build` in postinstall script

Here is the replication repo:
https://github.com/stomvi/nextjs-postinstall-build
Just run:
npm i -g git+ssh://git#github.com:stomvi/nextjs-postinstall-build.git
I am using next.js as a local web server as a part of a cli tool. I would like to build the next.js server after the tool is installed, so I put next build in the postinstall script in the package.json. The installation failed with an "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file." error.
Using
- next.js v9.0.4
- npm 6.9.0
The error shows that there might not be a jsx file loader for this. Local npm link works fine.
Failed to compile.
./pages/logs/[page].js 11:4
Module parse failed: Unexpected token (11:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| return (
> <Layout>
| <div className="card filter-container">
| <div className="card-header">
> Build error occurred
Error: > Build failed because of webpack errors
How could I make this work? Currently I just commit the .next dir into the repo.

Fail TeamCity build when angular-cli reports errors

I'm trying to configure team city to run angular 5 application build.
I have powershell step with this script (it's in the build step definition not separate file). npm run build runs ng build
npm install
npm run build
For some reason even if ng build fails team city build won't fail. Status code from npm run is not propagated back to powershell.
See below screen:
TeamCity Fails the build if got a status code != 0 or when got stderr.
You should add Failure Conditions for verifying that the log has an error.
Edit Configuration Settings -> Failure Conditions -> Add failure condition
Select Fail build on specific text in build log
Secelt options Contains and exact text. Set "npm ERR"
in Failure message write "Error was found in build log"
save
Now your build will be FAILED if build log contains this text.
Also, check an error message is logged by build runner

Vue-router. Error in the browser console after using "npm update" command. Error: Module build failed: Error: ENOENT: no such file or directory

Before updating project was working.
After updating with "npm update" command, browser console shows:
Error: Module build failed: Error: ENOENT: no such file or directory,
open
'C:\xampp\htdocs\beauty\node_modules\vue-router\dist\vue-router.esm.js'
In my bootstap file I add Vue-router like thiss
import VueRouter from 'vue-router';
window.Vue.use(VueRouter);
I don't understand where is problem and what should i do?
In my case, I had to restart the dev server since I've switched to a branch that had TypeScript introduced while started dev server on another (feature branch) that added vue-router but didn't have TS. I've merged and was puzzled why I got this error until I've realised that dev server probably doesn't recognize TS at all (depending on switching main.js to .ts and back I had the same or different error).