question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

These relative modules were not found: ./tracers/test/testSpan and ./tracers/test/testTracer

See original GitHub issue
  • Package Name: @azure/service-bus
  • Package Version: 7.0.2
  • Operating system: Windows
  • nodejs
    • version: 14.15.4
  • typescript
    • version: 4.1.3

Describe the bug

 ERROR  Failed to compile with 2 errors                                                                                                                                                                                                                                        07:50:28

These relative modules were not found:

* ./tracers/test/testSpan in ./node_modules/@azure/core-tracing/dist-esm/src/index.js
* ./tracers/test/testTracer in ./node_modules/@azure/core-tracing/dist-esm/src/index.js
 ERROR  Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce Steps to reproduce the behavior:

  1. Create a Vue 3 project
  2. Add Electron
  3. add @azure/service-bus
  4. try to use @azure/service-bus from the background.ts (backend code of electron)
  5. use yarn not npm

Reason is:

@azure/service-bus uses @azure/tracing

This has the following index.js

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
export { getTracer, setTracer } from "./tracerProxy";
// Tracers and wrappers
export { NoOpSpan } from "./tracers/noop/noOpSpan";
export { NoOpTracer } from "./tracers/noop/noOpTracer";
export { OpenCensusSpanWrapper } from "./tracers/opencensus/openCensusSpanWrapper";
export { OpenCensusTracerWrapper } from "./tracers/opencensus/openCensusTracerWrapper";
export { TestTracer } from "./tracers/test/testTracer";
export { TestSpan } from "./tracers/test/testSpan";
// Utilities
export { extractSpanContextFromTraceParentHeader, getTraceParentHeader } from "./utils/traceParentHeader";
//# sourceMappingURL=index.js.map

And finally the tracers directory does not contain test

Expected behavior A module should not export something, that is not part of that module.

A build should not fail.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
richardpark-msftcommented, Jan 27, 2021

Hi @MBurchard, okay I think I understand what happened here.

The problem here looks like it’s related to yarn autoclean, specifically driven by this file:

https://github.com/MBurchard/azureProblemDemo20210127/blob/86f64e4e83033353c9d1442c9f477b8a4a777706/.yarnclean#L3

The line I’ve linked to above removes all test folders in node_modules, which also removes the tracers/test folder, causing the build error. I’m not very familiar with using that file and I didn’t see an obvious way to say “test but not ‘tracers/test’” so it might be that the only solution is to remove that line altogether from your .yarnclean file.

I’m closing this issue but please re-open if you want to discuss this further.

0reactions
MBurchardcommented, Jan 28, 2021

Thank you for the support. So far I have not had any problems with the yarn autoclean feature. I use it primarily to ensure that when modules are uninstalled, the dependencies that are no longer needed are also cleaned up. I have commented out the entire section for testing.

# test directories
# __tests__
# test
# tests
# powered-test

Can I ask what the point of .yarnclean is? Is it to save disk space when developing? Wouldn’t bundling and tree shaking solve the problem in production?

@xirzec It is to save disk space on the developer machine. Over time in all that projects the amount of files in all that node_modules folders increases dramatically. Even though I have an SSD that is big enough, I am a fan of something taking out the trash.

Read more comments on GitHub >

github_iconTop Results From Across the Web

These relative modules were not found: · Issue #439 - GitHub
when runing dev-server there throw these two Error ERROR Failed to compile with 2 errors 10:53:28 These relative modules were not found: ....
Read more >
These relative modules were not found vue cli - Stack Overflow
My 'App.vue' style is:
Read more >
Vue.JS Error: This relative module was not found
I was making an update to a small Vue.JS side project when I encountered a build error: This relative module was not found...
Read more >
This relative module was not found: npm run watch - Laracasts
I am having some problem in my code. When I do npm run watch it throws errors below: This relative module was not...
Read more >
Error: This relative module was not found - Get Help - Vue Forum
I am trying to follow this tutorial by geekyants to implement a login screen for my app. The github repo for anyone interested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found