Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No known conditions for "." specifier in "vite-aliases" package #54

Closed
zqq-nuli opened this issue Feb 14, 2023 · 6 comments
Closed

No known conditions for "." specifier in "vite-aliases" package #54

zqq-nuli opened this issue Feb 14, 2023 · 6 comments
Labels
bug Something isn't working has workaround help wanted Extra attention is needed

Comments

@zqq-nuli
Copy link

node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1365:27: ERROR: [plugin: externalize-deps] Failed to resolve entry for package "vite-aliases". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "vite-aliases" package at failureErrorWithLog

@zqq-nuli
Copy link
Author

"dependencies": {
"vite": "^4.1.1"
},
"devDependencies": {
"vite-aliases": "^0.10.0"
}

@zqq-nuli
Copy link
Author

Failed to resolve entry for package "vite-aliases". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "vite-aliases" package

The only successful way is to import in this way

import { ViteAliases } from "./node_modules/vite-aliases/dist/index"

It seems that the path of "." of export in package.json has not been found, but I compared the package. json of vite and did not find any difference, and did not try to find a solution. I think the problem should not be in package.json

@Subwaytime
Copy link
Owner

Hey there! Sorry for the late response!

So this issue has been posted multiple times already, but i cant seem to replicate it! I have asked the other issue creators before, if they could provide a test repo and check if the example of vite-aliases runs for them! - It works perfectly for me (using linux), but i unfortunately cannot test against windows anymore..

@Subwaytime Subwaytime added bug Something isn't working help wanted Extra attention is needed labels Feb 22, 2023
@gpeu
Copy link

gpeu commented Feb 27, 2023

This solved it for me:

For those searching this error, it also gets triggered if you don't put type: module in your package.json.

from sveltejs/vite-plugin-svelte#556 (comment)

@batje
Copy link

batje commented Mar 7, 2023

Hey there! Sorry for the late response!

So this issue has been posted multiple times already, but i cant seem to replicate it! I have asked the other issue creators before, if they could provide a test repo and check if the example of vite-aliases runs for them! - It works perfectly for me (using linux), but i unfortunately cannot test against windows anymore..

It happens on linux, too. One project I have works, the second doesnt. Havent figured out the difference yet.

@Subwaytime
Copy link
Owner

This issue seems to appear only if you dont have

"type": "module"

in your package.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has workaround help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants