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

[Feature Request] Make it easier to override this package with local changes. #909

Open
jappeace opened this issue Apr 1, 2024 · 0 comments

Comments

@jappeace
Copy link

jappeace commented Apr 1, 2024

Is your feature request related to a problem? Please describe.
It took me several hours to deploy the changes to staging because it was so hard to just get my changes to be accepted by npm.

I added my depenedency like this:

 "dependencies": {
"html5-qrcode": "github:jappeace/html5-qrcode.git#expose-error-callback"
}

but it didn't work and it was confusing.
So I did the opposite of your adivce, ran a build and moved everything of dist into the project root (deleting the orignal root),
then I used that as a dependency on a branch.
This caused it to typecheck with my changes.

But for whatever reason it couldn't find itself:

Could not resolve "./html5-qrcode" from "node_modules/html5-qrcode/esm/index.js"
file: /home/jappie/projects/xxxxxxx/node_modules/html5-qrcode/esm/index.js
error during build:
RollupError: Could not resolve "./html5-qrcode" from "node_modules/html5-qrcode/esm/index.js"
    at error (file:///home/jappie/projects/xxxxxxxxx/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
    at ModuleLoader.handleInvalidResolvedId (file:///home/jappie/projects/xxxxxxxxxx/node_modules/rollup/dist/es/shared/node-entry.js:24855:24)
    at file:///home/jappie/projects/xxxxxxxxxxx/node_modules/rollup/dist/es/shared/node-entry.js:24817:26

I had no clue how to solve this,
after some trial and error I decided to make the build as simple as possible,
and maybe hone in on the problem?
So I deleted the esnext and module entrypoints from package.json:
jappeace@2794d94

Which fixed the problem.
I've no clue why.

Describe the solution you'd like
Make it so that a direct dependency just works, for example:

 "dependencies": {
"html5-qrcode": "github:jappeace/html5-qrcode.git#expose-error-callback"
}

Describe alternatives you've considered
Using another library to be honest. But that seemed more risky.

Additional context
We're a small startup project.

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

No branches or pull requests

1 participant