vite-aliases: Solid JS error

The main issue with SolidJS in vite using vite-aliases are :

  • Aliases are not generating in config.resolve.alias
Generator {
  options: {
    dir: 'src',
    prefix: '@',
    deep: true,
    depth: 1,
    createGlobalAlias: true,
    createLog: false,
    logPath: 'src/logs',
    adjustDuplicates: false,
    useAbsolute: false,
    useConfig: true,
    useIndexes: true,
    useTypescript: true,
    root: '***Omitted***'
  },
  fullPath: '***Omitted***',
  aliases: [],
  directories: Set(0) {},
  paths: {},
  searched: false,
  servermode: 'serve'
}
  • ERR_PACKAGE_PATH_NOT_EXPORTED ( current workaround is to update the package.json ).
Couldn't find package.json for vite-aliases Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in ***Omitted***\node_modules\vite-aliases\package.json
    at new NodeError (node:internal/errors:387:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:365:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:589:7)
    at resolveExports (node:internal/modules/cjs/loader:522:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:562:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:971:27)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)
    at***Omitted***node_modules/vite-plugin-solid/dist/esm/index.mjs:53:35
    at Array.map (<anonymous>)
    at getSolidDeps (***Omitted***node_modules/vite-plugin-solid/dist/esm/index.mjs:48:21) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Your example is working well so I figures it’s because of another vite plugins. I haven’t check with react but I will later.

I’m using Windows 10 btw, haven’t test it on Linux.

_Originally posted by @tsanyqudsi in https://github.com/Subwaytime/vite-aliases/issues/43#issuecomment-1283410165_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@houd1ni #43 (comment) The same question was asked and answered there. please do mind to check the issues using the search field.

Is “I can’t reproduce” an answer, really ? Or “most probably due to monorepo” is an answer ? I have no monorepo setting. And due to this half-abandoned issue, forced to use other solutions.

If you actually CLICKED the link provided, you should see this kind of view :

Untitled

And that’s the answer.

Mind that you displayed a despicable attitude in an open source project towards someone who IS NOT the owner of the project that trying to help.

Also barging in with your own Issue unrelated with the title of the issue and acting entitled.

It seems both issues are actually not related, so i am trying to fix all three, including the newly posted one. The ESM change will still persist, just needs a readme and example update

Any more Information on these Bugs would be great, as i cannot replicate them. Due to the Issues being stale, i have now closed them till there is more Information for me available that i can work with.

Working on some fixes atm! This seems to also clear the solidjs issue… 💯

Hm, so i cant seem to reproduce this! vite-aliases package.json has a exports section that should definitely be picked up… could you provide a test repo? 🤔 - Otherwise i am not sure if i can find the issue on my system…