Giter Club home page Giter Club logo

Comments (5)

GordonSmith avatar GordonSmith commented on June 8, 2024

When you execute tsc like this, it will ignore the tsconfig.json file.

To see it working you can run:

node_modules/.bin/tsc --module Node16 test.ts 

And then the following will produce the SVG output:

node ./test.js 

from hpcc-js-wasm.

GordonSmith avatar GordonSmith commented on June 8, 2024

@rubenlg - can you take a look at: #205 and see if it helps?

from hpcc-js-wasm.

rubenlg avatar rubenlg commented on June 8, 2024

When you execute tsc like this, it will ignore the tsconfig.json file.

You're right! The correct way to run tsc is to run without any arguments, that way it will read tsconfig.json and compile the typescript modules defined in that configuration (by default, all of them). i.e:

node_modules/.bin/tsc

If I do that, it tells me that I have to change another property in the tsconfig.json:

    "module": "Node16",

And looking at #205, it seems like moduleResolution is not needed, changing module is enough.

Sadly, I still can't use v2 for other reasons (it's a large project with many dependencies, and migrating to both module: Node16 in tsconfig.json and type: module in package.json will take a while, if it's at all possible). But that's independent from this issue.

Thanks for the examples!

from hpcc-js-wasm.

GordonSmith avatar GordonSmith commented on June 8, 2024

@rubenlg there are two examples in that PR:

  • ESM: Which is for the modern "module" type.
  • CommonJS: Which does not set either of the two settings above.

In theory the v2 library should be compatible with all TS setups, but given the variety of possible combinations it could be made easier for some of those...

If you could provide your tsconfig.json or setup I could add an example specific for that?

from hpcc-js-wasm.

rubenlg avatar rubenlg commented on June 8, 2024

Thanks! I ran the CommonJS example in the PR as is, and left a comment with the error I got.

from hpcc-js-wasm.

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.