How do I solve this error code in pubspec.yaml? - json

Error detected in pubspec.yaml:
Error on line 38, column 3: Expected a key while parsing a block mapping.
╷
38 │ cupertino_icons: ^1.0.2
│ ^
╵
Please correct the pubspec.yaml file at C:\Users\Kia Com\Documents\Restaurant_App\resto\pubspec.yaml
Exited (1)
My Code
enter image description here
enter image description here

The issue is with the indentation. The yaml file has strict indentation rule. Your pubspec.yaml should be like this.
dependencies:
flutter:
sdk: flutter
http: ^0.13.1
cupertino_icons: ^1.0.2
Notice the starting line of the http package. It should be one indent right of the dependencies tag and should match the indentation of flutter and cupertino_icons package.

Related

Forge Design Automation Revit Tutorial Error

I am trying the Design Automation Tutorial for Revit.
I am getting the following error.
Can someone help me fix this error.
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of ReadStream
at new NodeError (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\lib\internal\errors.js:372:5)
at write_ (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\lib\_http_outgoing.js:742:11)
at ClientRequest.end (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\lib\_http_outgoing.js:855:5)
at Request._end (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\node_modules\superagent\lib\node\index.js:1282:9)
at Request.end (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\node_modules\superagent\lib\node\index.js:1000:8)
at c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\node_modules\superagent\lib\request-base.js:282:12
at new Promise (<anonymous>)
at RequestBase.then (c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\node_modules\superagent\lib\request-base.js:264:31)
at c:\Users\roshan.kerketta\Desktop\Digital\Forge\ModelDesignAutomation\SampleDesignAutomation\node_modules\forge-apis\src\ApiClient.js:394:7
at processTicksAndRejections (node:internal/process/task_queues:96:5) {code: 'ERR_INVALID_ARG_TYPE', statusCode: undefined, stack: 'TypeError [ERR_INVALID_ARG_TYPE]: The "chunk"…ions (node:internal/process/task_queues:96:5)', message: 'The "chunk" argument must be of type string …nt8Array. Received an instance of ReadStream', toString: ƒ, …}
Thanks Rahul for spotting the issue! I can reproduce what #JohnKuldeepRoshanKerketta experienced in Forge SDK (forge-apis) in 0.9.0. By the hint of error, I updated the tutorial code(line 509,510) to use readFile, instead of file stream. Now it works well with 0.9.0.
I posted the Issue with tutorial
https://github.com/Autodesk-Forge/learn.forge.designautomation/issues/31
// 2. upload inputFile
const inputFileNameOSS = `${new Date().toISOString().replace(/[-T:\.Z]/gm, '').substring(0,14)}_input_${_path.basename(req.file.originalname)}`; // avoid overriding
try {
//let contentStream = _fs.createReadStream(req.file.path);
let fileContent = _fs.readFileSync(req.file.path);
await new ForgeAPI.ObjectsApi().uploadObject(bucketKey, inputFileNameOSS, req.file.size, fileContent, {}, req.oauth_client, req.oauth_token);
}
I want to understand what the error means, so it could help me fix the error., though it might be basic.
If your goal is to understand this specific error, then you can read this question/answer where it is best asked/explained. However since this is coming from Forge's nodejs apis, I think you did not write this code and you should not be concerned with it.
My best guess is you have somehow managed to upgrade the nodejs package forge-api to 0.9.0 and the rest of the tutorial repo/code is not compatible with it. You can check this with the following command:
cd {repo_folder}
npm ls -depth=0
You should see the following result:
├── autodesk.forge.designautomation#3.0.5
├── body-parser#1.20.0
├── cookie-session#1.4.0
├── express#4.18.1
├── forge-apis#0.8.6
├── form-data#4.0.0
├── multer#1.4.4
└── socket.io#4.5.1
If your forge-apis is showing 0.9.0 instead of 0.8.6, then it explains the error you have. To downgrade it, you can either delete your node_modules folder, undo any changes to package.json and/or package-lock.json and run npm install again.
Alternatively you can also explicitly downgrade the forge-api module.
cd {repo_folder}
npm install forge-apis#0.8.6 -save
npm ls -depth=0

How to import html file as template in typescript vue js project as module to use same html file in more than a component?

I am trying to load external html file in to Vuejs project in typescript language but typescript compiler gives me issue as below
ERROR Failed to compile with 1 errors 3:51:57 PM
error in ./src/components/common/dynamic-render.html
I dont have webpack.config.js as this project is generated through vue-cli
I tried to load file with the help of vue-template-loader ts-loader but still compiler throws same issue
Dashboard.vue
import WithRender from "./common/dynamic-render.html";
#WithRender
#Component
I am getting below error
ERROR Failed to compile with 1 errors 3:51:57 PM
error in ./src/components/common/dynamic-render.html
Module parse failed: Unexpected token (1:0)
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
Have you defined shims-html.d.ts as explained in this article?

Primefaces extension codemirror error

primefaces extension code mirror is not working as expected.
Loaded primefaces 6.1 and its supporting jar's.
commons-lang3-3.1,gson-2.2.4,primefaces-extensions-6.1.0
primefaces-extensions-6.1.0- doesn't have resources.primefaces.extensions.codemirror and got the below error
WARNING [org.primefaces.util.ResourceUtils] (default task-58) Resource not
found, ignore it. Name: codemirror/codemirror.js, Library: primefaces-
extensions
.
I added those css and js manually.
Now completemethod is not firing and got the below exception in browser.
Uncaught SyntaxError: Unexpected token <
at eval (<anonymous>)
at jquery.js.xhtml?ln=primefaces&v=6.1:14
at Function.globalEval (jquery.js.xhtml?ln=primefaces&v=6.1:14)
at text script (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at af (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at cf (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at i (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at Object.send (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at Function.ajax (jquery.js.xhtml?ln=primefaces&v=6.1:25)
at Function.bH._evalUrl (jquery.js.xhtml?ln=primefaces&v=6.1:25)
link of jar files used:
https://files.fm/u/ak23jeht

building IONIC 3 Project not working

ng build --prod
Date: 2017-12-16T12:11:38.469Z
Hash: 9af9d0824b91129853ac
Time: 3766ms
chunk {0} (styles) [initial] [rendered]
chunk {1} polyfills.bf31271ed8358d9c1c6b.bundle.js (polyfills) 155 bytes [initial] [rendered]
chunk {2} main.a0f3445c4f3c97baab24.bundle.js (main) 149 bytes [initial] [rendered]
chunk {3} inline.c30c9795283a00740af2.bundle.js (inline) 1.45 kB [entry] [rendered]
ERROR in multi ./src/main.ts
Module not found: Error: Can't resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/c
li/models/webpack-configs'
resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/models/webpack-configs'
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/package.json (relative path: ./src/main.ts)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts.js doesn't exist
as directory
/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts doesn't exist
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts.ts]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts.js]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/main.ts]
# multi ./src/main.ts
ERROR in multi ./src/polyfills.ts
Module not found: Error: Can't resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angu
lar/cli/models/webpack-configs'
resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/models/webpack-configs'
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/package.json (relative path: ./src/polyfills.ts)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts.ts doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts.js doesn't exist
as directory
/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts doesn't exist
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts.ts]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts.js]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/polyfills.ts]
# multi ./src/polyfills.ts
ERROR in multi ./src/styles.css
Module not found: Error: Can't resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angula
r/cli/models/webpack-configs'
resolve '/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css' in '/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/models/webpack-configs'
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#angular/cli/package.json (relative path: ./models/webpack-configs)
using description file: /Users/tyyiu/Documents/Code/IONIC/quorra/package.json (relative path: ./src/styles.css)
no extension
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css.js doesn't exist
as directory
/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css doesn't exist
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css.ts]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css.js]
[/Users/tyyiu/Documents/Code/IONIC/quorra/src/styles.css]
# multi ./src/styles.css
ERROR in TypeError: Cannot read property 'length' of undefined
at createSourceFile (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/typescript/lib/typescript.js:16640:109)
at parseSourceFileWorker (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/typescript/lib/typescript.js:16572:26)
at Object.parseSourceFile (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/typescript/lib/typescript.js:16521:26)
at Object.createSourceFile (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/typescript/lib/typescript.js:16371:29)
at new TypeScriptFileRefactor (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#ngtools/webpack/src/refactor.js:79:35)
at Object.resolveEntryModuleFromMain (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#ngtools/webpack/src/entry_resolver.js:108:20)
at Promise.resolve.then.then (/Users/tyyiu/Documents/Code/IONIC/quorra/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:240:54)
File Tree:
src/tsconfig.json; src/app; src/pages
-> I put the tsconfig.json into the src folder because otherwise, an error says it can't find it.
I would like to know where the error results in and why. if it is because I put the tsconfig.json in the src/folder, then why does then the error of not finding the file, even though it is right there?
My tsconfig.json is just from: https://github.com/kristofferandreasen/simple-ionic-3-app/blob/master/tsconfig.json
first run
npm i
then run the following command
ionic cordova build --release android --prod
That's how you build an angular project not Ionic project. Here's how, you can choose one of the following commands:
$ ionic build
$ ionic cordova build ios
$ ionic cordova build ios --prod --release
$ ionic cordova build ios --device --prod --release -- --developmentTeam="ABCD" --codeSignIdentity="iPhone Developer" --packageType="app-store"
$ ionic cordova build android
$ ionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myalias
$ ionic cordova build android --prod --release -- -- --minSdkVersion=21
$ ionic cordova build android --prod --release -- -- --versionCode=55
But from what I see you may want $ ionic build

Jekyll Build Error for hmfaysal-omega-theme

I downloaded the Omega theme and try to start on my MAC:
But i get this error:
Configuration file: /Users/rname/jekyll/hmfaysal-omega-theme-gh-pages/_config.yml
Source: /Users/rname/jekyll/hmfaysal-omega-theme-gh-pages
Destination: /Users/rname/jekyll/hmfaysal-omega-theme-gh-pages/_site
Generating...
Build Warning: Layout 'none' requested in feed.xml does not exist.
jekyll 2.5.3 | Error: Operation not permitted # unlink_internal - /Users/rnagaraj/jekyll/hmfaysal-omega-theme-gh-pages/_site/LICENSE
As per this and this, try deleting the license file.