I have an electron app and I got this error when run electron-builder build.
Error: Application entry file "main.js" in the "/project/dist/release/mac/demo.app/Contents/Resources/app.asar" does not exist. Seems like a wrong configuration.
This is package.json. I have set the main to dist/electron.js but I don't understand why it keep saying main.js doesn't exist.
...
"main": "dist/electron.js",
"build": {
"productName": "demo",
"appId": "com.auspost.pos",
"files": [
"dist/",
"node_modules/**/*",
"package.json",
"dist/electron.js"
],
"directories": {
"output": "dist/release"
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
"nsis",
"msi"
],
"icon": "./electron/assets/icons/win/app.ico"
},
"publish": {
"provider": "github"
}
},
...
"devDepencencies": {
"electron": "^5.0.2",
"electron-builder": "^20.41.0",
"electron-webpack": "^2.6.2",
}
Finally figure out that because the project has electron-webpack dependency which works as a base template for electron build configuration. There are some fields are defined there which get extended.
The fix for that is either remove electron-webpack from your project dependencies or use electron-webpack convention to manage your project.
I had a similar issue:
Application entry file "index.js" in the ".....\dist\win-unpacked\resources\app.asar" does not exist.
The fix for me was to add
main: "main.js"
in the package.json of the generated app, so .\app\package.json.
Seems like without this electron-builder 21 (electron 6) is looking for a "index.js" file.
I encountered the error when selecting the production version of my entry file which was in a different folder than the source production file.
Here is the relevant config section that got my app to build:
"build": {
"files": [
"electron-settings.json",
"package.json"
],
"extraResources": [
{
"from": "../build/backend/min",
"to": "app",
"filter": [
"**/*"
]
},
{
"from": "desktop/node_modules",
"to": "node_modules"
}
],
"mac": {
"extraResources": [
{
"from": "build/osx",
"to": "app/build/osx"
}
]
}
}
Related
I have created a NX plugin/lib named nx.
The plugin's package.json defines the linting target:
"lint": {
"executor": "#nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/nx/executors.json",
"libs/nx/package.json",
"libs/nx/src/executors",
"libs/nx/src/generators"
]
}
}
The .eslintrc.json is:
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"]
}
The extended .eslintrc.json is:
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["#nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"#nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:#nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:#nrwl/nx/javascript"],
"rules": {}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
The problem is that the generator dir contains templates for generating ts apps and each app has its own .eslintrc.json file. So when I run linting for some reason it parses these files resulting in an error:
Failed to load config "../../.eslintrc.base.json" to extend from.
Referenced from:
[...]/libs/nx/src/generators/application/template/.eslintrc.json
I tried to update the ignorePatterns of my config
{
"ignorePatterns": ["!**/*", "**/*.eslintrc.json"]
}
but without success. How can I solve this problem?
I am getting following when running eslint in a Gatsby project
Oops! Something went wrong! :(
ESLint: 7.32.0
[ProjectNotFoundError: File '/home/path_to_project/somefile.ts' doesn't match any project] {
name: 'ProjectNotFoundError',
message: "File '/home/path_to_project/somefile.ts' doesn't match any project"
}
My .eslintrc
{
"extends": [
"react-app",
"plugin:jsx-a11y/recommended",
"prettier",
"plugin:tailwindcss/recommended"
// "airbnb"
],
"plugins": ["jsx-a11y"],
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": ["#/features/*/*"]
}
],
"tailwindcss/classnames-order": "error",
"tailwindcss/no-custom-classname": "error"
},
"settings": {
"tailwindcss": {
"groupByResponsive": true
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"processor": "#graphql-eslint/graphql",
"parser": "#typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:#typescript-eslint/recommended"
],
"env": {
"es6": true
}
},
{
"files": ["*.graphql"],
"parser": "#graphql-eslint/eslint-plugin",
"plugins": ["#graphql-eslint"],
"rules": {
"#graphql-eslint/no-anonymous-operations": "error",
"#graphql-eslint/naming-convention": [
"error",
{
"OperationDefinition": {
"style": "PascalCase",
"forbiddenPrefixes": ["Query", "Mutation", "Subscription", "Get"],
"forbiddenSuffixes": ["Query", "Mutation", "Subscription"]
}
}
]
}
}
]
}
.eslintignore
node_modules/
.cache/
public/
.idea/
yarn-error.log
.yarn/
Commenting out the following section in .eslintrc fix the issue, but I want to keep that section, things used to work fine with that section before. No clue what's wrong, since the error message provided by ESLint is pretty vague.
{
"files": ["*.ts", "*.tsx"],
"processor": "#graphql-eslint/graphql",
"parser": "#typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:#typescript-eslint/recommended"
],
"env": {
"es6": true
}
},
Update
Problem seems to be due to following, since commenting it out fix the error.
"processor": "#graphql-eslint/graphql",
I was earlier using Gatsby's GraphQL Typegen disabled due to it buggy nature (rebuild loop and .cache errors) by commenting out graphql.config.js and removing graphqlTypegen: true, from gatsby-config.ts
According to graphql-eslint
If you are defining GraphQL schema or GraphQL operations in code files, you'll want to define an additional override to extend the functionality of this plugin to the schema and operations in those files.
{
"overrides": [
+ {
+ "files": ["*.js"],
+ "processor": "#graphql-eslint/graphql"
+ },
...
}
It seems, disabling GraphQL Typegen result in mentioned error in "processor": "#graphql-eslint/graphql" of eslint override.
I use create-react-app and just want to add rules to my package.json. I see that I can disable this rule, but how? In the official document, only the phrase "If you don't want to enforce a style for using equality operators, then it's safe to disable this rule."
https://github.com/eslint/eslint/blob/master/docs/rules/eqeqeq.md#when-not-to-use-it
I found that i can write this:
// package.json
{
"name": "mypackage",
...,
"eslintConfig": {
"rules": {
"eqeqeq": "off"
}
}
}
but it not works.
I would like to clarify the question. The reason for my question here is not that I don't know how to disable the rule, I do not know how to disable it in the package.json. I just don't want to clutter up the project's root directory with an additional file.
you can add an eslint configuration file .eslintrc and disable the rules you want inside it.
docs
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:#angular-eslint/recommended",
"plugin:#angular-eslint/template/process-inline-templates"
],
"rules": {
"#angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"#angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:#angular-eslint/template/recommended"
],
"rules": {
"#angular-eslint/template/eqeqeq": "off"
}
}
]
}
Look at the last rule
Now as how to turn it to "smart" rather than "off" I'm yet to figure that out.
** Notice how its in the "files": [.html] or "files": [.ts]. I put mine in the .html rules because my errors were in html files but if they were in a ts file I'd put the rule there instead.
EDIT 1: I found this website useful https://github.com/nrwl/nx-examples/blob/master/.eslintrc.json
Go to your project root folder (where is packaje.json) and create a file named .eslintrc.json
Inside this add the following:
{
"rules": {
"eqeqeq": "off",
}
}
Then re launch the app and the rule should be disabled.
You may locate the eslint configuration file, and change eqeqeq rule to off:
eqeqeq: 'off',
Also, make sure that you don't override the setting farther.
Go to .eslintrc.js then add
rules: {
eqeqeq: 'off',
},
I'm trying to deploy a node / express API that has several endpoints for use at now.sh.
My question is how to correctly configure the file now.json.
leave the image where you can see the complete structure of the project, the main path would be the ./src/ where are all the folders and files.
The main entrypoint is http://localhost:3000/api/v1/ for localhost
I delete the file now.json and from the terminal I paste the now command, and then I generated the deployment in the following path
https://ryuanime.chrismichael.now.sh
But when I try to go to https://ryuanime.chrismichael.now.sh/api/v1 it shows me 404: NOT_FOUND
Image
source code
now.json
{
"version": 2,
"name": "ryuanime",
"builds": [
{
"src": "src/index.ts",
"use": "#now/node-server"
}
],
"routes": [{"src": "/(.*)", "dest": "/src/index.ts"}]
}
For some reason it worked by referring to
"src": "./src/index.ts"
and not
"src": "src / index.ts",
{
"name": "ryuanime-api",
"version": 2,
"builds": [
{
"src": "./src/index.ts",
"use": "#now/node-server"
}
],
"routes": [
{ "src": "/(.*)", "dest": "/src/index.ts" }
]
}
I'm creating a flatpak package for vlc. Since flatpak runs in sandbox and vlc depends on lua -> guile -> bdw-gc -> libunistring.
I have to first compile all these dependencies into flatpak sandbox. However bdw-gc and libunistring`` compile perfectly, butguilefails in last step ofmake` with error:
make[1]: Leaving directory '/run/build/guile'
stripping /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/bin/guile to /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/bin/guile.debug
stripping /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/libguile-2.0.so.22.8.1 to /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/lib/libguile-2.0.so.22.8.1.debug
Error: module guile: Error opening file '/home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/source/guile/libguile/scmconfig.h': Permission denied
I'm using flatpak-builder for that using manifest file as:
{
"app-id": "org.gnome.vlc",
"runtime": "org.gnome.Platform",
"runtime-version": "3.22",
"sdk": "org.gnome.Sdk",
"command": "vlc",
"finish-args": [
"--socket=x11",
"--share=network",
"--share=ipc",
"--filesystems=host"
],
"modules": [
{
"name": "bdw-gc",
"sources": [
{
"type": "archive",
"url": "http://www.hboehm.info/gc/gc_source/gc-7.6.0.tar.gz",
"sha256": "a14a28b1129be90e55cd6f71127ffc5594e1091d5d54131528c24cd0c03b7d90"
}
]
},
{
"name": "libunistring",
"sources": [
{
"type": "archive",
"url": "http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.6.tar.xz",
"sha256": "2df42eae46743e3f91201bf5c100041540a7704e8b9abfd57c972b2d544de41b"
}
]
},
{
"name": "guile",
"sources": [
{
"type": "archive",
"url": "https://ftp.gnu.org/gnu/guile/guile-2.0.13.tar.xz",
"sha256": "3744f2addc282a0de627aaef048f062982b44564d54ac31ff5217972529ed88b"
}
]
},
{
"name": "autogen",
"sources": [
{
"type": "archive",
"url": "https://ftp.gnu.org/gnu/autogen/rel5.18/autogen-5.18.tar.xz",
"sha256": "0c2dce22d4306ea29a01f6e54a35ea2b42dc7cf14f9818057b785e375bfbb784"
}
]
},
{
"name": "lua",
"sources": [
{
"type": "archive",
"url": "https://www.lua.org/ftp/lua-5.3.3.tar.gz",
"sha256": "5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2"
}
]
},
{
"name": "vlc",
"sources": [
{
"type": "archive",
"url": "http://get.videolan.org/vlc/2.2.4/vlc-2.2.4.tar.xz",
"sha256": "1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be"
}
]
}
]
}
How can I solve this problem, or what is another approach to include vlc in flatpak?