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

resolve error introduced with 2.5.2 #260

Closed
tripodsan opened this issue Oct 20, 2023 · 10 comments · Fixed by #261
Closed

resolve error introduced with 2.5.2 #260

tripodsan opened this issue Oct 20, 2023 · 10 comments · Fixed by #261
Assignees

Comments

@tripodsan
Copy link
Collaborator

we have a monorepo and use esmock in one of the npm workspaces: https://github.com/adobe/helix-shared/tree/main/packages/helix-shared-bounce

https://github.com/adobe/helix-shared/blob/ed6523ad6cced4d55db00edf76081e61f463ff28/packages/helix-shared-bounce/test/bounce.test.js#L170-L174

but since version 2.5.2, we get this error:

     Error: ENOENT: no such file or directory, realpath './src/index.js'

version:

$ npm ls esmock
@adobe/[email protected] 
└─┬ @adobe/[email protected] -> ./packages/helix-shared-bounce
  └── [email protected]
@tripodsan
Copy link
Collaborator Author

I moved the code to its own project, and the error still occurs.... so it is not related to the monorepo.

@tripodsan tripodsan changed the title resolve error introduced with 2.5.2 in monorepos resolve error introduced with 2.5.2 ~in monorepos~ Oct 20, 2023
@tripodsan tripodsan changed the title resolve error introduced with 2.5.2 ~in monorepos~ resolve error introduced with 2.5.2 Oct 20, 2023
@koshic koshic self-assigned this Oct 20, 2023
@koshic
Copy link
Collaborator

koshic commented Oct 20, 2023

image

@tripodsan as you can see, issue is related to @adobe/fetch resolving (tested with esmock 2.5.6). I'll continue investigation.

@koshic
Copy link
Collaborator

koshic commented Oct 20, 2023

esmock resolver can't properly handle that combination of main, module and type: module
image

main field totally ignored, module handled incorrectly. CC @iambumblehead

@iambumblehead
Copy link
Owner

a couple of different versions of the loader have been published since the last esmock was published... let's try publishing with the latest loader and see if that resolves the issue

@koshic
Copy link
Collaborator

koshic commented Oct 20, 2023

a couple of different versions of the loader have been published since the last esmock was published... let's try publishing with the latest loader and see if that resolves the issue

Loader? I tested it with latest esmock & resolvewithplus code copied from github repos.

@iambumblehead
Copy link
Owner

@koshic ok thanks I have time to try and resolve this now

@iambumblehead
Copy link
Owner

recently using the resolver to process import trees with thousands of modules has surfaced a lot of little issues lately,

@iambumblehead
Copy link
Owner

I believe I've found the issue... pushing changes to the resolver repo soon

@iambumblehead
Copy link
Owner

@iambumblehead
Copy link
Owner

@tripodsan thanks for finding and reporting the issue -- if there are any problems please open or reopen any issue

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 a pull request may close this issue.

3 participants