React js Failed to compile Errer - node.js

I moved to windows 11 from Linux , so i imported all my code from Linux..to windows . So whenever i try to run a react project , I get a compile error stating :-
`
./src/Componets/shop/products.JSON
Module parse failed: Unexpected token m in JSON at position 0 while parsing near 'module.exports = __w...'
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token m in JSON at position 0 while parsing near 'module.exports = __w...'
at JSON.parse (<anonymous>)
`

Related

error trying to recreate php's dechex function in python3

i have a php file that takes a simple 8 digit id and converts it to hex using
dechex(intval($id))
i am now trying todo the same thing in python i start by grabbing my list of ids from the web these are returned as strings such as
00274956 , 00002645, 00000217
i then convert them to intagers and hex them using
hex(int(item_id))
but i am getting the error
ValueError: invalid literal for int() with base 10: 'init'
here is the code the id comes direct from a http get request
FILE_NUMBER = int(ITEM_ID)
FILE_HEX = hex(FILE_NUMBER)
FILE_NEW = FILE_HEX + ".pdf"

include variable in ejs blocks :unexpected token error %

I am trying to append a variable with block in ejs
this is my variable <%=sails.config.items.base_url%>
<%block('searchScript','<script src='<%=sails.config.items.base_url%>'></script>')%>
But i got the following error
"stack": "SyntaxError: Unexpected token %= in \"/var/www/node/cushbuart/views/user/edit-art.ejs\"\n
Try this
<%=sails.config.items.base_url%>
<%block('searchScript','<script src='+ sails.config.items.base_url +'></script>')%>

Syntax error when trying to input errors for a set of data

I'm trying to create a graph using Jupyter Notebooks but when I input errors for a data set "syntax error" appears referring to the word error, any ideas on the problem?
measured_time2 = q.MeasurementArray(
data = [0,0.2,1.0,2.2,4.0,6.2,9.0,12.2,16.0,20.2,25]
error = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1])
File "<ipython-input-36-96c22be70112>", line 8
error = [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1])
^
SyntaxError: invalid syntax

Netsuite CSV import(An unexpected error has occurred)

Below is the sample code, i am using in CSV Import process.
var createJob = nlapiCreateCSVImport();
createJob.setMapping("CUSTIMPORTcust_pay");
createJob.setPrimaryFile("Data_string");
createJob.setOption("jobName", "Test imports");
var JobId = nlapiSubmitCSVImport(createJob);
nlapiSubmitCSVImport function is returning JobId without any error, but in job status page[UI] it showing status is failed and in Message field it showing "An unexpected error has occurred", CSV Response field also empty. when i try this by running the above code with same data again, some time it is successfully imported and some time it got failed, with showing message "An unexpected error has occurred"
Please see setPrimaryFile(file).
Where file is either:
The internal ID, as shown in the file cabinet, of the CSV file containing data to be imported, referenced by nlapiLoadFile. For example:
.setPrimaryFile(nlapiLoadFile(73))
Raw string of the data to be imported.
You are passing in a raw string of "Data_string".

"Generator already running" message on any error

I have a very simple generator function, like this
exports.whatever = function *(next) {
this.body = 'wow';
z
};
Now, there obviously is a syntax error here ('z' on the third line),
but with koa's generators, the error I get in the console is basically useless for debugging; I do not get the line of the error, the file, or even the type of error. All I get is:
Error: Generator is already running
at GeneratorFunctionPrototype.next (native)
at onFulfilled (/Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:59:19)
at /Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:48:5
at Object.co (/Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:47:10)
at Object.toPromise (/Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:112:63)
at next (/Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:93:29)
at onRejected (/Users/johndoe/Documents/nodejs/testing/node_modules/koa/node_modules/co/index.js:79:7)
Is there any way to see the real detail of the error? Thanks in advance.

Resources