Slackbot
11/28/2022, 9:20 AMnitya-signoz
11/28/2022, 10:58 AMIndra R
11/28/2022, 11:11 AM/app/src/App.js:1
import './App.css';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1088:15)
at Module._compile (node:internal/modules/cjs/loader:1123:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
at node:internal/main/run_main_module:23:47
Node.js v19.0.1
Vishal Sharma
11/28/2022, 12:30 PMpackage.json
of sample app to add support for npm run start:noenv
It should work now, let me know if you face any issues.Indra R
11/28/2022, 12:34 PMVishal Sharma
11/28/2022, 12:36 PMpackage.json
update start script as below:
"scripts": {
"start": "node -r ./tracing.js index.js"
},
Indra R
11/28/2022, 12:38 PMIndra R
11/28/2022, 12:40 PMIndra R
11/28/2022, 12:47 PMnpm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR! npm star # Mark your favorite packages
npm ERR! npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-11-28T12_44_36_062Z-debug-0.log
i tried build app using sample app above, and this error show up
this is my dockerfile
FROM node:19-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install react-scripts --legacy-peer-deps
RUN npm install -g npm@9.1.2
COPY . .
EXPOSE 3000
CMD ["npm", "run", "start"]
anything i miss ?Vishal Sharma
11/28/2022, 12:48 PMnpm run start:noenv
Vishal Sharma
11/28/2022, 12:49 PMCMD ["npm", "run", "start"]
With
CMD ["npm", "run", "start:noenv"]
Indra R
11/28/2022, 12:50 PMIndra R
11/28/2022, 12:50 PMVishal Sharma
11/28/2022, 12:52 PMstart
or start:noenv
Like we did here:
https://github.com/SigNoz/sample-nodejs-app/blob/592c7b35e38eb3607e97cc8708a40f81a5936066/package.json#L12Indra R
11/28/2022, 1:03 PM> app-core@0.1.0 start:noenv
> node -r ./tracing.js ./src/App.js
/app/src/App.js:1
import './App.css';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1088:15)
at Module._compile (node:internal/modules/cjs/loader:1123:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
at node:internal/main/run_main_module:23:47
Node.js v19.0.1
any suggestion for me ?Vishal Sharma
11/28/2022, 1:57 PM./App.cs
which is unrelated to signoz.Indra R
11/28/2022, 2:11 PMSigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.
Powered by