GithubHelp home page GithubHelp logo

Comments (4)

hou5emd avatar hou5emd commented on June 2, 2024 3

@abaksha-sc check on 4.2.3, because it`s work for me

from typescript-plugin-css-modules.

sshrshnv avatar sshrshnv commented on June 2, 2024 1

@mrmckeb when will this fix be published in npm?

from typescript-plugin-css-modules.

SLTKA avatar SLTKA commented on June 2, 2024

I think issue is in this line

languageServiceHost.getResolvedModuleWithFailedLookupLocationsFromCache
getResolvedModuleWithFailedLookupLocationsFromCache is not defined by default in TS, like in my VSCode language server it stays undefined for TS 4.9.5 and 5.1.3 (haven't tested others).

Which config can I use to have getResolvedModuleWithFailedLookupLocationsFromCache defined?

Another challenge that we can override isCSS but not isRelative. Maybe having custom resolver override would be the easiest solution if this is possible, or fallback to Node resolution (just thinking at loud, haven't check this ideas)


Update:

For us the issue with paths is not the biggest challenge as we still can use relative paths. However, if we import a CSS module from a NPM package this plugin can't resolve it, manually adding (patching package)

} else if (isCSS(moduleName) && typeof require.resolve === "function") {
                  return {
                      extension: ts.Extension.Dts,
                      isExternalLibraryImport: true,
                      resolvedFileName: require.resolve(moduleName),
                  };
                }

on line https://github.com/mrmckeb/typescript-plugin-css-modules/blob/2e502074b9f370dd8d970bc7e6e8a970bf57ba59/src/index.ts#LL205C10-L205C10 solves our issue, would be nice to have something similar included

from typescript-plugin-css-modules.

marcoms avatar marcoms commented on June 2, 2024

Also facing this issue so having to just use relative paths which isn't ideal. It would be great to get hints working for absolute paths, especially as the '@/...' style is becoming more common.

from typescript-plugin-css-modules.

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.