-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot find module './Instrumentation.js' when running frontend service for local development #407
Comments
Are you running the command from the root folder of the project? |
@julianocosta89 - Correct, I'm running it from the root folder. |
Cool, just to be sure. |
I'm on the road ATM, I will take a look later. |
Thanks @julianocosta89. @xoscar all I can tell at this point is that npm is being run in production mode as opposed to dev. In package.json, there's the requirement for ./Instrumentation.js in "start" (which is referenced in the error above) "start": "node --require ./Instrumentation.js server.js" Whereas "dev" in package.json is what we're looking to run from what I can tell as it has the correct relative path to Instrumentation.js: "dev": "npm run grpc:generate && NODE_OPTIONS='-r ./utils/telemetry/Instrumentation.js' next dev" So, I think the answer lies in understanding why start is firing off instead of dev when running "docker compose run..." command in the frontend README file. |
Oh I think it's because a change was made to move away from |
Also, @puckpuck do you see any issue if we return the |
The only issue I see is consistency with the other services, which all use |
@puckpuck if consistency is the only issue, I'll go ahead and send a PR to use |
Hello all, I've just sent a PR fixing this :) |
Bug Report
Which version of the demo you are using?
main (latest)
Symptom
I'm trying to follow the README for running the frontend service locally. After running
docker compose run --service-ports -e NODE_ENV=development --volume$(pwd)/src/frontend:/app --volume $ (pwd)/pb:/app/pb frontend sh
I get this error:
Error: Cannot find module './Instrumentation.js'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at Module._preloadModules (node:internal/modules/cjs/loader:1303:12)
at loadPreloadModules (node:internal/bootstrap/pre_execution:583:5)
at prepareMainThreadExecution (node:internal/bootstrap/pre_execution:95:3)
at node:internal/main/run_main_module:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
It looks like npm start is being run (per package.json) as opposed to npm dev. Am I doing something wrong here?
Reproduce
Just follow the instructions for running the frontend service locally in the README file.
The text was updated successfully, but these errors were encountered: