This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I want to have a very stripped down version of the cat-tracker-app that just deals with settings,

I want to have a very stripped down version of the cat-tracker-app that just deals with settings, so I can import what is useful to an existing web application. I am new to web applications, but learned some of the languages. However, I cannot run anything. For example

Burt@T420S MINGW64 ~/nrf-asset-tracker/cat-tracker-web-app (saga)
$ npm start

> @nordicsemiconductor/[email protected] start
> PUBLIC_URL=/ react-scripts --max_old_space_size=4096 start

'PUBLIC_URL' is not recognized as an internal or external command,
operable program or batch file.

Oh, npm test does run. npm build took so long on my slow computer I figured it is not what I am looking for.

I cannot do anything with node after I "tsc --jsx react". For example, if I throw in a few console.log()s and try 

$ node index.js

I get


cloudFlavour=AWS
version=0.0.0-development
index.js line 45
hi
hi2
C:\Users\Burt\nrf-asset-tracker\cat-tracker-web-app\node_modules\@amcharts\amcha
rts4\core.js:8
export { System, system } from "./.internal/core/System";
^^^^^^

SyntaxError: Unexpected token 'export'
at compileFunction (<anonymous>)
at Object.compileFunction (node:vm:355:18)
at wrapSafe (node:internal/modules/cjs/loader:1022:15)
at Module._compile (node:internal/modules/cjs/loader:1056:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (C:\Users\Burt\nrf-asset-tracker\cat-tracker-web-app\s
rc\HistoricalData\HistoricalDataChart.js:8:15)

It's a beautiful program but if I cannot experiment with it so that I can pull out a few good ideas we need like the red lights next to settings, it is of little value to me. The textbooks are not helpful when I get the SyntaxError problem shown above.  Thanks.

Parents
  • I am making progress with using tsc. I saw bizarre messages when the compiler ended up at src/azure/api.ts and I was able to eventually track it down to extraneous non printable characters n the stream, for example, using "od -c"

                                                       c o n s t
    279 0010540 d e l 357 270 217 = < A e x t e
    280 0010560 n d s { [ k e y :

    Both lines 166 and 205 have this problem after the word "del". Octal 357 270 217 is Decimal 239 184 143, and my ASCII table shows decimal 143 as the extended ASCII code for the last letter in the Norwegian alphabet, what I think of as the abbreviation used for Angstroms.

    Another issue I had is that the dependency history at version 5.0.0 will not allow me to compile; I needed a version <5.0.0.

    I am working through another set of gotchas, hopefully a small set.

    Can you make corrections to the git repository?

Reply
  • I am making progress with using tsc. I saw bizarre messages when the compiler ended up at src/azure/api.ts and I was able to eventually track it down to extraneous non printable characters n the stream, for example, using "od -c"

                                                       c o n s t
    279 0010540 d e l 357 270 217 = < A e x t e
    280 0010560 n d s { [ k e y :

    Both lines 166 and 205 have this problem after the word "del". Octal 357 270 217 is Decimal 239 184 143, and my ASCII table shows decimal 143 as the extended ASCII code for the last letter in the Norwegian alphabet, what I think of as the abbreviation used for Angstroms.

    Another issue I had is that the dependency history at version 5.0.0 will not allow me to compile; I needed a version <5.0.0.

    I am working through another set of gotchas, hopefully a small set.

    Can you make corrections to the git repository?

Children
  • Hi Markus,

    I wanted to reply to your very helpful message, but I cannot find a Reply button below, so I will type here and hope you see this. You really were able to get me over a few stumbling blocks. I'm sure I had used a bundler (browsify) a few years ago on a different project, but at this time I was trying to use Flanagan's JavaScript textbook and also the Typescript website to get started -- Flanagan does not even mention bundling. Finally, my attempts to run npm start -- I would see the development server browser come up, blank and connection icon spinning -- and I would quit out, not realizing that I have to wait a long time before I see console output. The one thing I was able to google was the PUBLIC_URL shell syntax issue so I had that under control.

    I may not be able to interest my colleague in this -- so far he has only been interested in "can I get a JSON packet to the device, in a format the device understands," without having any interest in acknowledgements. But I figure eventually a customer will come along that is unhappy with that, especially if we use PSM or EDRX.

    You got me on track, and I may have more questions later.

Related