Skip to content

Reproduction issue with vite 3.1.4#83

Closed
belgattitude wants to merge 1 commit intomainfrom
vite-3-1-4-reproduction
Closed

Reproduction issue with vite 3.1.4#83
belgattitude wants to merge 1 commit intomainfrom
vite-3-1-4-reproduction

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

Comments