Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Wrong module resolution #18

Open
fusionstrings opened this issue Dec 2, 2019 · 4 comments
Open

Wrong module resolution #18

fusionstrings opened this issue Dec 2, 2019 · 4 comments

Comments

@fusionstrings
Copy link
Contributor

Could be related with #10 .
Following is a simple reproduction
https://github.com/fusionstrings/jspm-resolve-test
https://glitch.com/~jspm-resolve-test

Here https://github.com/fusionstrings/jspm-resolve-test/blob/master/test.js I am trying to get resolved module type and despite being package.json.type : "module", /module.js is resolving to commonjs and missing module is not throwing error.

Based on my understanding is type is set to "module" it should resolve to js files as module.

@guybedford
Copy link
Member

guybedford commented Dec 3, 2019 via email

@fusionstrings
Copy link
Contributor Author

Sorry @guybedford no, I didn't use github master branch. I used the package from github master branch now.
It still didn't work.
I notice that the tests don't pass on master branch as well and throw same error.

 Error: Recursive symlink resolving 
      at Object.realpathSync (resolve.js:914:13)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)
      at Object.realpathSync (resolve.js:927:19)

Following is the check, which you may inspect
https://github.com/fusionstrings/jspm-resolve/pull/2/checks?check_run_id=331310229

I have also created a pull request against main repo. #19

@guybedford
Copy link
Member

@fusionstrings you might need to ensure the parent is process.cwd() + path.sep.

The symlink issue looks like a bug to me that is unrelated, but would be good to fix too.

@fusionstrings
Copy link
Contributor Author

Ok, so after a long debug session I managed to get it working but certainly at the core is conflict between npm install and jspm install. I will post the better finding ASAP.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants