Coder Social home page Coder Social logo

Comments (5)

jfsiii avatar jfsiii commented on May 27, 2024 1

This "Are the types wrong?" tool is really helpful for types and more general package issues.

It found a few issues

Screenshot 2023-07-19 at 11 12 06 AM

You can also npm pack a local install and upload it to iterate on the changes. There's also a CLI

from otel-cf-workers.

evanderkoogh avatar evanderkoogh commented on May 27, 2024

Hey! I am absolutely no wizard in module systems either.

But you are absolutely correct in that I would like this to "just work" for everyone.. so certainly going to have a look to see what the best way forward is.

from otel-cf-workers.

evanderkoogh avatar evanderkoogh commented on May 27, 2024

Ok.. so I have tried to follow the gist of all the module system wizards and it looks like it works now, but I would love for you to give this a go and check if that is indeed actually the case. It was released in 1.0.0-rc3.

from otel-cf-workers.

oxcafedead avatar oxcafedead commented on May 27, 2024

@evanderkoogh Thanks for looking at this issue!
Can you please check your index.ts? There are a couple of imports without .js left.

UPD
For now, I decided to fix them manually to see what will be the result (sorry I didn't do it earlier)
Found couple of other places:
sdk.ts (the very bottom):export { waitUntilTrace } from './instrumentation/fetch';
provider.ts: import { AsyncLocalStorageContextManager } from './context'

Then I got another error:

file:///xxx/node_modules/@microlabs/otel-cf-workers/dist/esm/spanprocessor.js:2 
import { stateMachine } from 'ts-checked-fsm';
         ^^^^^^^^^^^^
SyntaxError: Named export 'stateMachine' not found. The requested module 'ts-checked-fsm' is a CommonJS module, which 
may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'ts-checked-fsm';
const { stateMachine } = pkg;

I rewrote the import to

import fsm from 'ts-checked-fsm';
import { getActiveConfig } from './config.js';

const { stateMachine } = fsm;

Then I got:

> npx mocha

ReferenceError: caches is not defined
    at _instrumentGlobalCache (file:///xxx/node_modules/@microlabs/otel-cf-workers/dist/esm/instrumentation/cache.js:67:30)

And this is probably because I try to run tests in a NodeJS runtime where there is no CacheStorage available, because it is not a browser nor a Worker runtime like a Miniflare.

I think I will additionally migrate the tests to wrangler dev to use Miniflare then...

Maybe couple of mentioned imports are worth to fix for consistency, though.

Thanks again.

from otel-cf-workers.

evanderkoogh avatar evanderkoogh commented on May 27, 2024

Right..

So I just retested 1.0.0-rc.7 and it passed all of the things.

Screenshot 2023-07-26 at 22 22 14

Can you let me know if this still happens?

from otel-cf-workers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.