resourge / shallow-clone

MIT License
0 stars 0 forks source link

Error with Vitest when trying to import @resourge/shallow-clone #1

Closed samuelbelo closed 3 days ago

samuelbelo commented 5 days ago

When trying to import a component that uses @resouge/react-form inside a test file, Vitest throws the following error:

SyntaxError: Named export 'shallowClone' not found. The requested module '@resourge/shallow-clone' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:

import pkg from '@resourge/shallow-clone'; const { shallowClone } = pkg;

Reproducible example: https://stackblitz.com/edit/vitejs-vite-de68ru?file=package.json,src%2FAppModel.ts,src%2FApp.tsx,tests%2Findex.test.tsx&terminal=dev

run:

npm run test

See error on Terminal. image

resourge commented 5 days ago

Hi, thanks for bringing the error to my atencion. Monday I will check it out and fix the problem. thanks

resourge commented 3 days ago

Hi, update @resourge/shallow-clone and @resourge/react-form to fix this problem. Thanks for the feedback.