Giter Site home page Giter Site logo

Comments (3)

mjpieters avatar mjpieters commented on July 1, 2024 1

Durn, I could have sworn I had tried the moduleResolution options. My apologies!

I'm creating user scripts that inject into Stack Exchange, so the final output is self-contained and I had not given this parameter enough thought.

from stacks-icons.

mjpieters avatar mjpieters commented on July 1, 2024

Just to be clear: I am nowhere near confident that my diagnosis is correct.

I do have a work-around, you can use the paths option in tsconfig.json to force resolution:

{
  "compilerOptions": {
    "moduleResolution": "node",
    "target": "ES2020",
    "baseUrl": "./",
    "paths": {
      "@stackoverflow/stacks-icons/icons": ["node_modules/@stackoverflow/stacks-icons/dist/icons"]
    }
  },
  "files": ["index.ts"]
}

That's the same tsconfig.json but with baseUrl and paths added.

from stacks-icons.

giamir avatar giamir commented on July 1, 2024

We are using package.json subpath exports in stacks-icons to map paths to specific entrypoints:
https://github.com/StackExchange/Stacks-Icons/blob/production/package.json#L11-L22

You are using "moduleResolution": "node" which does not support package.json exports.
The value "node" represents the resolution of Node 10, which never included package.json exports support (exports started to be supported from Node 12+).
If you change the moduleResolution value to nodenext (or any node >= 12) everything should work as expected.

For more context: microsoft/TypeScript#51901

from stacks-icons.

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.