Module not found: Error: Can't resolve '../../package.json' in /node_modules/@opencensus/core/build/src/common' #752
Comments
Thanks for reporting this! I tried reproducing this locally with Node 10, looks fine to me. Maybe something to do with angular universal build. |
Could you please confirm the path of |
@mayurkale22, thank you so much for your prompt reply. The Here is
Error:
The
I tried to upload the screenshot of app structure here but failed with |
I am running webpack analysis "https://webpack.github.io/analyse/" and here are details:
It looks like it tries to load package.json in this /node_modules/@opencensus/core/build/package.json.js which does not exist. I might suggest to update the line in https://github.com/census-instrumentation/opencensus-node/blob/master/packages/opencensus-core/src/common/version.ts#L30 to pjson = require('./../../../package.json');. It will look like this:
|
Thanks for sharing the details, the easiest option I can think is to hard code the current version and update it during each release. WDYT? |
@mayurkale22, thanks for your response. I think it should be fixed for the current version. |
@draffensperger what do you think about fixing the current version? If you agree, I will open the PR and update the |
Hi Mayur, yeah, I think hard coding the current version is fine and I agree with fixing problems that come up in |
Published in |
Hi @mayurkale22, thank you so much. The error above is gone. 👍 |
I forgot to mention about the WARNING:
I am wondering if this is caused by nodejs version. |
can anyone tell me what should I do to solve this issues |
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
0.0.19
What version of Node are you using?
12.4.0
What did you do?
If possible, provide a recipe for reproducing the error.
I am running the angular universal build for production and I got the error below:
What did you expect to see?
No such error as above
What did you see instead?
Additional context
Add any other context about the problem here.
Here is the implementation in
server.ts
file:The text was updated successfully, but these errors were encountered: