Git Product home page Git Product logo

Comments (14)

muratgozel avatar muratgozel commented on July 28, 2024 1

@andreid42tech type declaration is scoped with declare module 'mimetext' so ideally, there shouldn't be any conflict but I'll check this out and maybe will just publish dist and types as you have suggested. I need a few days for this, thanks for bringing this up.

besides, i would recommend to check if there is any package you have installed called @types/mimetext. remove it if exists.

from mimetext.

muratgozel avatar muratgozel commented on July 28, 2024 1

closing this issue as all the type recognition issues has been resolved.

from mimetext.

muratgozel avatar muratgozel commented on July 28, 2024

hi @andreid42tech that was probably because of the naming issue in the type declaration file, just fixed it. could you update and confirm that the issue resolved?

from mimetext.

andreid42tech avatar andreid42tech commented on July 28, 2024

hi @andreid42tech that was probably because of the naming issue in the type declaration file, just fixed it. could you update and confirm that the issue resolved?

Hey, it didn't help.

image

from mimetext.

muratgozel avatar muratgozel commented on July 28, 2024

@andreid42tech could you share your setup so I can simulate your environment and test it? Share repository if possible, or your ide, package.json and other config files.

from mimetext.

andreid42tech avatar andreid42tech commented on July 28, 2024

@andreid42tech could you share your setup so I can simulate your environment and test it? Share repository if possible, or your ide, package.json and other config files.

That would be difficult, something to mention is that we are using the mono-repos with multiple tsconfigs and I would guess that there's something messy happening because mimetext comes with its full source code and its tsconfig inside node_modules, maybe we should ship only the dist and TS typings?

from mimetext.

andreid42tech avatar andreid42tech commented on July 28, 2024

@andreid42tech type declaration is scoped with declare module 'mimetext' so ideally, there shouldn't be any conflict but I'll check this out and maybe will just publish dist and types as you have suggested. I need a few days for this, thanks for bringing this up.

besides, i would recommend to check if there is any package you have installed called @types/mimetext. remove it if exists.

Thanks!

from mimetext.

muratgozel avatar muratgozel commented on July 28, 2024

hi @andreid42tech update to the latest version please, is the problem still continue?

from mimetext.

andreid42tech avatar andreid42tech commented on July 28, 2024

Hey @muratgozel, yes, I think it is due to this library being sourced fully and not bundled/compiled, could that be true?

image

from mimetext.

ColinCee avatar ColinCee commented on July 28, 2024

I'm getting the same error when switching typescript config moduleResolution to node16

This is most likely related to the mess that is es modules, either this repo needs to support esm or just stick to using commonjs modules

See similar issue microsoft/TypeScript#51406

from mimetext.

zhahaoyu avatar zhahaoyu commented on July 28, 2024

I am facing the same issue with "mimetext": "^3.0.16",

Here is the sample tsconfig.

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"]
}

from mimetext.

zhahaoyu avatar zhahaoyu commented on July 28, 2024

Here is the error
Screen Shot 2023-09-27 at 10 49 17 PM

Looks like it is trying to resolve es module one and cannot use the type

from mimetext.

iainmerrick avatar iainmerrick commented on July 28, 2024

Just sent a PR which fixes this for me: #50

It's a bit clunky and doesn't handle CJS but should at least get things working for ES users.

from mimetext.

muratgozel avatar muratgozel commented on July 28, 2024

@andreid42tech i have updated type generations, give it another go if possible, please, it should all be fixed now.

from mimetext.

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.