Skip to content
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

Compilation error in Angular #966

Closed
gpra opened this issue Apr 14, 2020 · 8 comments · Fixed by #981
Closed

Compilation error in Angular #966

gpra opened this issue Apr 14, 2020 · 8 comments · Fixed by #981
Assignees
Labels
bug Something isn't working

Comments

@gpra
Copy link

gpra commented Apr 14, 2020

What version of OpenTelemetry are you using?

0.6.1

What version of Node are you using?

13.11.0

What did you do?

Tried to use @opentelemetry in an Angular project. Just:

1 - include the dependency:

npm i @opentelemetry/tracing

2 - Try to use it:
import { SimpleSpanProcessor } from '@opentelemetry/tracing';

What did you expect to see?

Compile OK

What did you see instead?

Compilation error:
ERROR in ./node_modules/@opentelemetry/core/build/src/trace/instrumentation/BasePlugin.js
Module not found: Error: Can't resolve 'path' in './node_modules/@opentelemetry/core/build/src/trace/instrumentation'

Additional context

File "@opentelemetry/core/build/src/trace/instrumentation/BasePlugin.js", line 19 imports "path":
const path = require("path");

Commenting lines 19, 77 and 80 solves the problem.

@gpra gpra added the bug Something isn't working label Apr 14, 2020
@dyladan dyladan self-assigned this Apr 15, 2020
@dyladan
Copy link
Member

dyladan commented Apr 15, 2020

@obecny I think it may be time to split the BasePlugin into specific node/web versions

@dyladan
Copy link
Member

dyladan commented Apr 15, 2020

/cc @mayurkale22

@obecny
Copy link
Member

obecny commented Apr 15, 2020

we can just split it to 3 files, base abstract and then node and web using the platform folder ?

@obecny
Copy link
Member

obecny commented Apr 15, 2020

Just wondering what has changed recently that this is not working anymore ?. As it was fine quite recently

@dyladan
Copy link
Member

dyladan commented Apr 15, 2020

It's probably some issue with his specific bundler or something like that. The BasePlugin definitely uses the path module, though it should only actually use it in node plugins. It looks like he is using some sort of static analysis that looks at the source and sees the path module may be used.

@obecny
Copy link
Member

obecny commented Apr 15, 2020

anyway we should split it asap ;)

@obecny
Copy link
Member

obecny commented Apr 23, 2020

#967

@dyladan dyladan linked a pull request Apr 29, 2020 that will close this issue
@dyladan
Copy link
Member

dyladan commented May 12, 2020

@gpra the fix for this should go out with the release today

pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants