in Odoo 13, I am facing this error when open configuration in Dashboard ninja:
SyntaxError: Unexpected token F in JSON at position 0
at JSON.parse (<anonymous>)
at Class.init (http://localhost:8069/web/content/329-72f1291/web.assets_backend.js:2478:363)
at Class.init (http://localhost:8069/web/content/329-72f1291/web.assets_backend.js:2479:328)
at Class.init (http://localhost:8069/web/content/319-8bc33a0/web.assets_common.js:3864:371)
at new Class (http://localhost:8069/web/content/319-8bc33a0/web.assets_common.js:3862:65)
at Class._createViewController (http://localhost:8069/web/content/329-72f1291/web.assets_backend.js:442:658)
at http://localhost:8069/web/content/329-72f1291/web.assets_backend.js:447:169
Can you help?
Related
I am trying to get some value from Youtube Api. Now, My express code is->
https.get("https://www.googleapis.com/youtube/v3/videos?part=snippet&id=qW_SWM1wpMA&key=MYAPIKEY",function(res){
res.on("data",function(data){
const da=JSON.parse(data);
console.log(da);
})
});
Now, I am console log the data what's coming from api. But I get this error->
$ node app.js
Port is running
undefined:13
"description": "\"Bang Bhaja\" shows how Nonte and Fonte makes a trick to punish Keltu for punishing them from Superintendent Sir for eating the Ilish Maach.\n\nNonte Fonte is a Bengali comic-strip creation of Narayan Debnath which originally was serialized for the childre
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (C:\Users\LENOVO\Desktop\youtube\app.js:13:19)
at IncomingMessage.emit (events.js:314:20)
at IncomingMessage.Readable.read (_stream_readable.js:514:10)
at flow (_stream_readable.js:987:34)
at resume_ (_stream_readable.js:968:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
But when paste the API link (what's mention in above in https.get method) in chrome I get the json data successfully. Then why not i getting the json data in terminal?
I am re-writing an existing js app into angular and ts. I have a json data file that I read as part of the startup of the existing js app and it works fine. When I try and read the exact same file with the exact same line of code in angular, ts/angular barfs all over it. Here is the code from the existing app:
aircraftData = JSON.parse(data);
and the console log is empty. Here is the the code from the new angular version of the app:
const content = require('./shared/imeiXref.json');
console.log("IMEI=",content[0].IMEI);
and the console output:
AppComponent_Host.ngfactory.js? [sm]:1 ERROR SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse (<anonymous>)
at AppComponent.push../src/app/app.component.ts.AppComponent.ngOnInit (app.component.ts:33)
at checkAndUpdateDirectiveInline (core.js:22089)
at checkAndUpdateNodeInline (core.js:23353)
at checkAndUpdateNode (core.js:23315)
at debugCheckAndUpdateNode (core.js:23949)
at debugCheckDirectivesFn (core.js:23909)
at Object.eval [as updateDirectives] (AppComponent_Host.ngfactory.js? [sm]:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:23901)
at checkAndUpdateView (core.js:23297)
View_AppComponent_Host_0 # AppComponent_Host.ngfactory.js? [sm]:1
proxyClass # compiler.js:18234
push../node_modules/#angular/core/fesm5/core.js.DebugContext_.logError #
core.js:24129
push../node_modules/#angular/core/fesm5/core.js.ErrorHandler.handleError # core.js:15762
(anonymous) # core.js:18116
push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke #
zone.js:391
.....
Is JSON expected to be in a different format from js to angular/ts?
Thanks....
It was actually already working. I didn't realize that when I read the file in I was already able to parse the JSON by field name so I don't even need to run JSON.parse.
I added the ngx-tawk template to my app.component.html to my lazy-loaded application.
<!--app.component.html-->
<router-outlet></router-outlet>
<ngx-tawk [id]="XXXXXXXXXXXXXXXXXXX"></ngx-tawk>
I get the error
Uncaught Error: Template parse errors:
Parser Error: Unexpected token 'XXXXXXXXXXXXX' at column 2 in [5bb4aa97b033e9743d021435] in ng:///AppModule/AppComponent.html#2:10 ("ent below is only a placeholder and can be replaced.-->
<router-outlet></router-outlet>
<ngx-tawk [ERROR ->][id]="XXXXXXXXXXXXX"></ngx-tawk>
The XXXXXXXXXXXXX is id provided by tawk.io
I'm trying to make "RESTful" using CodeIgniter 3.1.5 and libraries https://github.com/chriskacerguis/codeigniter-restserver
I get this error:
Fatal error: Call to undefined factory function () in D:\AppServ\www\restful\application\libraries\REST_Controller.php on line 857
A PHP Error was encountered
Severity: Error
Message: Call to undefined function factory ()
Filename: libraries/REST_Controller.php
Line Number: 857
Backtrace:
(Not my code, but it is example from codeigniter-restserver)
enter in line 61 of autoload.php
$autoload['libraries'] = array('database','Format');
I solved it that way.
When I try to include the node-rsa library with Webpack, as so:
import NodeRSA from 'node-rsa';
I get the following error:
ERROR in ./~/constants-browserify/constants.json
Module parse failed: /home/hencic00/Dropbox/Documents/Camelot/node_modules/constants-browserify/constants.json Unexpected token (2:12)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (2:12)
at Parser.pp$4.raise (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:2221:15)
at Parser.pp.unexpected (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:603:10)
at Parser.pp.semicolon (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:581:61)
at Parser.pp$1.parseExpressionStatement (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:966:10)
at Parser.pp$1.parseStatement (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:730:24)
at Parser.pp$1.parseBlock (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:981:25)
at Parser.pp$1.parseStatement (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:709:33)
at Parser.pp$1.parseTopLevel (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:638:25)
at Parser.parse (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:516:17)
at Object.parse (/home/hencic00/Dropbox/Documents/Camelot/node_modules/acorn/dist/acorn.js:3098:39)
at Parser.parse (/home/hencic00/Dropbox/Documents/Camelot/node_modules/webpack/lib/Parser.js:902:15)
at DependenciesBlock.<anonymous> (/home/hencic00/Dropbox/Documents/Camelot/node_modules/webpack/lib/NormalModule.js:104:16)
at DependenciesBlock.onModuleBuild (/home/hencic00/Dropbox/Documents/Camelot/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
at nextLoader (/home/hencic00/Dropbox/Documents/Camelot/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
at /home/hencic00/Dropbox/Documents/Camelot/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
at Storage.finished (/home/hencic00/Dropbox/Documents/Camelot/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
at /home/hencic00/Dropbox/Documents/Camelot/node_modules/graceful-fs/graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
# ./~/node-rsa/src/NodeRSA.js 10:16-36
There doesn't seem to be any existing questions on this topic.
Any ideas?
Just add json loader to your webpack config.