Skip to content

chore: update fastify to ^5.0.0#169

Merged
Fdawgs merged 2 commits intomainfrom
chore/mass
Oct 18, 2024
Merged

chore: update fastify to ^5.0.0#169
Fdawgs merged 2 commits intomainfrom
chore/mass

Conversation

@Fdawgs
Copy link
Copy Markdown
Member

@Fdawgs Fdawgs commented Sep 18, 2024

See fastify/fastify#5694

Checklist

@mcollina
Copy link
Copy Markdown
Member

@Fdawgs can you take a look at why this is failing?

@gurgunday
Copy link
Copy Markdown
Member

Not sure why there is node 10, 16 here?

🚭 Syntax detected in the module is incompatible with the module kind according to the package.json or file extension. This is an error in Node and may cause problems in some bundlers. https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/UnexpectedModuleSyntax.md


┌───────────────────┬──────────────────────────────────┐
│                   │ "@fastify/type-provider-typebox" │
├───────────────────┼──────────────────────────────────┤
│ node10            │ 🟢                               │
├───────────────────┼──────────────────────────────────┤
│ node16 (from CJS) │ 🚭 Unexpected module syntax      │
├───────────────────┼──────────────────────────────────┤
│ node16 (from ESM) │ 🟢 (ESM)                         │
├───────────────────┼──────────────────────────────────┤
│ bundler           │ 🟢                               │
└───────────────────┴──────────────────────────────────┘

@Fdawgs
Copy link
Copy Markdown
Member Author

Fdawgs commented Oct 17, 2024

Issue is that the dist/cjs/index.js file built when running build:cjs has ESM import syntax in it:

"use strict";
import { TypeCompiler } from '@sinclair/typebox/compiler';
import { Value } from '@sinclair/typebox/value';
export * from '@sinclair/typebox';
export const TypeBoxValidatorCompiler = ({ schema, httpPart }) => {
    const typeCheck = TypeCompiler.Compile(schema);
    return (value) => {
        const converted = httpPart === 'body' ? value : Value.Convert(schema, value);
        if (typeCheck.Check(converted)) {
            return { value: converted };
        }
        const errors = [...typeCheck.Errors(converted)];
        return {
            error: errors.map((error) => ({
                message: `${error.message}`,
                instancePath: error.path
            }))
        };
    };
};

Since the last successful release on September 4th, TypeScript 5.6 released, so that may have broken it?
I know TypeScript doesn't follow semver and they put breaking changes in minor releases.

@Fdawgs
Copy link
Copy Markdown
Member Author

Fdawgs commented Oct 17, 2024

Yep, if i pin typescript to 5.4.5 instead of ^5.4.5 then it's fine.

image

@climba03003
Copy link
Copy Markdown
Member

I recommend always use ~ for TypeScript since TypeScript use x.y as major version and .z for patch.

@Fdawgs Fdawgs merged commit 739876a into main Oct 18, 2024
@Fdawgs Fdawgs deleted the chore/mass branch October 18, 2024 09:03
peruukki added a commit to peruukki/feast that referenced this pull request Nov 16, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Also after upgrading, we get this warning when running `yarn build` but
it can be ignored for now:

```
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.6.3

Please only submit bug reports when using the officially supported version.
```
peruukki added a commit to peruukki/feast that referenced this pull request Nov 23, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
peruukki added a commit to peruukki/feast that referenced this pull request Nov 28, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
dmartinol pushed a commit to feast-dev/feast that referenced this pull request Dec 1, 2024
Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
lokeshrangineni pushed a commit to lokeshrangineni/feast that referenced this pull request Dec 2, 2024
)

Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
tmihalac pushed a commit to tmihalac/feast that referenced this pull request Dec 3, 2024
)

Lock the TypeScript minor version by using `~` instead of `^` in the
version specifier, see
fastify/fastify-type-provider-typebox#169 (comment).

After upgrading, the TypeScript compiler complained that the `long`
package has no default export. Related fixes:

- Add the latest `long` version as a direct dependency since our code
  uses it directly; no compilation errors with the latest version

- The `long` package exports a `Long` class, so use a capital first
  letter in the import name to match that

Signed-off-by: Harri Lehtola <[email protected]>
Signed-off-by: Theodor Mihalache <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants