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

Reproduction issue with vite 3.1.4 #83

Closed
wants to merge 1 commit into from

Conversation

belgattitude
Copy link
Owner

@belgattitude belgattitude commented Sep 29, 2022

Vite issue: vitejs/vite#10292
Upstream changes: vitejs/vite#10215 and vitejs/vite#10207
easy fix: set target to node14in vitest

Possible regression with vite 3.1.4 (move to esnext) ?

yarn install
cd packages/http-exception
yarn test-unit

Failing test:

it('should support sending a cause', () => {
let exception: HttpException;
const errorCause = new Error('Origin error');
try {
throw errorCause;
} catch (cause) {
exception = new HttpException(500, {
cause: cause as unknown as Error,
});
}
expect(exception.cause).toStrictEqual(errorCause);
expect((exception.cause as unknown as Error).message).toStrictEqual(
'Origin error'

image

Easy workaround:

Change the target to 'node14 or later' in vitest esbuild config

Done in #82 - https://github.com/belgattitude/http-exception/pull/82/files#diff-bf307cafcebcb7d56cd0b4a3017f12f6a1ba9a768ecd1de52df5c77158cf2e78

@belgattitude belgattitude changed the title chore(dev-deps): update to vite 3.1.4 Reproduction issue with vite 3.1.4 Sep 29, 2022
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.

1 participant