-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[4.0.1] Cannot find module fast-json-stringify/serializer #3998
Comments
Hmm I am using yarn v3.2.1 and it seems as if it is not pulling version 4.1.0 of "fast-json-stringify@npm:^4.0.0":
version: 4.0.0
resolution: "fast-json-stringify@npm:4.0.0"
dependencies:
ajv: ^8.10.0
ajv-formats: ^2.1.1
deepmerge: ^4.2.2
fast-uri: ^2.0.0
rfdc: ^1.2.0
string-similarity: ^4.0.1
checksum: be75cc7f87a8cf8623a135de5513aae80e39cdc4df7f9f3c735c686f77f501edd06fa8361026cd6be3628ac4e5ff2f5fe804a9ab11b9ffb828979965548b5af4
languageName: node
linkType: hard |
Yup deleting the lock file does work, but like you said in the linked issue it's not a great solution. |
It's an unacceptable workaround imo, there's no reason to not bump the dependency. |
Even if it is bumped in If it is a |
If it is an actual problem, I see fastify/fast-json-stringify#461 is a better option. |
Update all your dependencies and it will resolved. |
full demo import Fastify from 'fastify';
const fastify = Fastify({
logger: true
});
fastify.get('/', async (request, reply) => {
return { hello: 'world' };
});
/**
* Run the server!
*/
const start = async () => {
try {
await fastify.listen({ port: 3000 });
} catch (err) {
fastify.log.error(err);
process.exit(1);
}
};
start(); Also, @mcollina why close this issue when your suggestion was not verified by the person who raised the issue? |
As I said, running |
@mcollina what Repro code is exactly as i showed. deps and the code, there is no need for the repo. |
This issue is solved in What is the |
@Eomm thanks for the answer, i don't use npm, i use pnpm + rushstack. You are correct, the I've updated the fastify in one micro-service, the rest are on 3.x. Please check the screenshot, this shouldn't be an issue since pnpm already solves the duplicates issues by correctly creating the paths. Could it be that the fastify has issues when having two different versions? If you are not familiar with rushstack, it's like the workspace, each microservice has |
I sincerely do not understand what the problem is. Please upload a repository that is failing with the latest version of all dependencies. We'll be happy to take a look. I also do not understand the issue with "update all dependencies" and why you do not want to do this. |
That is not correct: https://github.com/fastify/fast-json-stringify-compiler/blob/main/package.json#L31 This means we have a dependency tree that, in production, goes: fastify 4.0.1 -> fast-json-stringify-compiler 3.0.0 -> fast-json-stringify 4.0.0 |
@mcollina because most of the time |
It's not "a workaround". It is the whole purpose of semver ranges. We will not be updating all modules everywhere every time a transitive dependency bumps a minor or patch version that is included in the qualifying semver range. |
https://github.com/fastify/fast-json-stringify-compiler/blob/864956aede405c9408392945972fd985fa6e440d/package.json#L31 clearly shows that it will pull in Update your dependencies. |
I agree with the analysis but it is not necessary to publish a new release. Did you try the |
|
I agree with @zedeus. This IS an issue in fastify. #3996 introduced a production dependency on fast-json-stringify (see these lines), and more to that, to a specific version (4.0.1) of that library. If fastify now depends on it, it should be declared in fastify's production dependencies rather than assuming that it will come in some form through a transitive dependency. Fixed in #4004 |
I would see fastify/fast-json-stringify#461 to be merged and publish. |
This is correct. Sorry for the issue and the great write up @zedeus and @simoneb! --
Let's fix it first. |
Thank you for linking to the actual code. We definitely want to add direct dependencies to the dependencies list. I think we really need a CI step that does:
That should catch these cases in the future as neither of the options in step one will install the transitive dependency in such a fashion that Fastify itself will have access to it. |
Prerequisites
Last working version
4.0.0
Stopped working in version
4.0.1
Node.js version
18.3.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Docker
💥 Regression Report
following error when starting my application:
Steps to Reproduce
Use simple hello world:
and start it using
node app.js
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: