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
@loopback/build: lb-eslint
throws "Package subpath './bin/eslint' is not defined by 'exports'" when in npm workspaces environment
#9703
Comments
I tried adding this line in eslint's package json and it worked. But not sure if it's the right solution and how do I patch this for everyone in the team. Raised this on their repo too: eslint/eslint#17321 {
"name": "eslint",
"version": "8.43.0",
"bin": {
"eslint": "./bin/eslint.js"
},
"main": "./lib/api.js",
"exports": {
"./package.json": "./package.json",
+ "./bin/eslint": "./bin/eslint.js",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
},
... |
@frbuceta can you please check this issue. This will block all of our projects using LoopBack from using npm workspaces. |
The command is not failing me... I will check it tomorrow with more time. |
Thanks, You can refer the reproduction code I've mentioned in the issue comment at the top. Or try running: |
Try the changes I made in this branch... https://github.com/loopbackio/loopback-next/tree/frbuceta/fix-exports-eslint |
The changes worked for npm workspaces, Thanks @frbuceta! I didn't try with lerna though. But based on the code changes I see there shouldn't be any issue on that too IMO. Can we have these applied in the actual |
I can see that I have the same issue. Did this find its way t @loopback/build package or are we waiting for that still ? :) |
I still have exactly the same issue. @frbuceta did these changes make it into Currently this issue blocks us from runnings tests in pipelines. I have tried upgrading every package related to this, but still get the same issue. When i run
The same fix described by #9703 (comment) also fixes the problem for me. But thats of course not a viable long term option |
Describe the bug
Running
lb-eslint
command from a package in npm workspaces environment throws following error:Full Command:
lb-eslint --report-unused-disable-directives .
Logs
Additional information
Reproduction
https://codesandbox.io/p/github/shubhamp-sf/eslint-17321-reproduction/main
The text was updated successfully, but these errors were encountered: