Closed gabrielkim13 closed 10 months ago
idk if its related, but jest also starts throwing errors:
node_modules/@automapper/classes/src/index.d.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './lib/classes';
^^^^^^
SyntaxError: Unexpected token 'export'
> 1 | import { AutoMap } from '@automapper/classes';
| ^
i tried different configs like adding the package to the transformIgnorePatterns
or using jest with its esm configs, but i was not able to resolve the error on the new version.
I'm not sure whether the jest error is related to this issue.
The change to @automapper/classes
's package.json
that causes the issue with pkg
was made in a2dea1d (2023-03-10), while version 8.7.7 was released earlier (2022-10-25), so it's possible.
Someone else said that the error occurred in 8.7.7, but he/she removed the comment. Can you verify this @timonmasberg?
Someone else said that the error occurred in 8.7.7, but he/she removed the comment. Can you verify this @timonmasberg?
I can not reproduce the error on 8.7.7, its probably not related to this issue but rather to this change
Solved with #589.
Is there an existing issue for this?
Describe the issue
Hi there, @nartc!
First of all, thank you for taking the time to merge pending PRs and releasing version 8.8.0 of automapper-ts!
Unfortunately, it seems that some of these changes have introduced a minor issue in the
@automapper/classes
package:Turns out that "./" is not a valid key for
package.json
'sexports
option.For me, this is an issue when using pkg to generate single-executable Node binaries, as I get the following error:
It seems to me that the fix is as simple as replacing "./" with just ".".
Models/DTOs/VMs
N/A
Mapping configuration
N/A
Steps to reproduce
Just open
@automapper/classes
on VSCode to get the aforementioned warning.Expected behavior
The main export of
@automapper/classes
should be correctly identified when usingpkg
to generate single-executable Node binaries.This is fixed by exporting ".", instead of "./", which is not a valid export path.
Screenshots
No response
Minimum reproduction code
No response
Package
Other package and its version
No response
AutoMapper version
8.8.0
Additional context
Linux Node v20