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

module is installed but "Unable to resolve path to module 'windows-1252' import/no-unresolved" #3114

Open
rafipiccolo opened this issue Dec 12, 2024 · 1 comment

Comments

@rafipiccolo
Copy link

nodejs: 23.4.0
eslint: 9.16.0
eslint-plugin-import: 2.31.0

when i run eslint i get this error

mytest.js
  2:30  error  Unable to resolve path to module 'windows-1252'  import/no-unresolved

the file only does

import * as windows1252 from 'windows-1252';

i have this package in my package.json

{
  dependencies: {
    "windows-1252": "^3.0.4"
  }
}

The package exists and is in my node_modules folder.
it contains a package.json stating this

node_modules/windows-1252/package.json
{
    "exports": "./windows-1252.mjs",
    "files": [
		"LICENSE-MIT.txt",
		"windows-1252.mjs",
		"windows-1252.d.ts"
    ],
    "types": "windows-1252.d.ts",

all thoses files exist

Is it a bug in this plugin or in windows-1252 ?
Other packages seem to be recognized just fine.

@ljharb
Copy link
Member

ljharb commented Dec 12, 2024

This plugin doesn’t yet support “exports”, and that package doesn’t define “main”. When resolve supports the exports field, so will we.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants