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

importing sibling module via index results in unresolved dependency (undefined) #1580

Closed
akomm opened this issue Jan 20, 2022 · 2 comments
Closed

Comments

@akomm
Copy link

akomm commented Jan 20, 2022

What version of Remix are you using?

1.1.1

What version of Node are you using? Minimum supported version is 14.

14.15.0

Steps to Reproduce

Open and run dev the following:
https://stackblitz.com/edit/github-gqhf1n-zbcsjo

It should instantly fail with TypeError: Cannot read properties of undefined (reading 'omit') breaking through all error boundaries.

Notes:

  • in routes/index.tsx: import { doStuff } from '~/module';
  • in module/index.ts: export * from ./b and ./a, the order is important! (b first)
  • in module/b.ts: it imports from ./a via index (~/module)

AFAIK esmodule-wise this is not an error and schould work, since its static and I do not use circular import. I think compilation fails due to being confused importing something via the same index as its sibling. Order makes a difference, when a is exported first in index, error goes away. Also when not importing via index.

This is a problem, because relative imports in 95% are a problem. So I always run vsc with non-relative. I think many will do this to make refactoring and moving things easier. Also with import-optimization runs, its ordered and hence this error will randomly trigger based on file name and order.

Expected Behavior

no TypeError

Actual Behavior

TypeError

@akomm akomm added the bug Something isn't working label Jan 20, 2022
@akomm akomm changed the title [Bug]: [Bug]: importing sibling module via index results in unresolved dependency (undefined) Jan 20, 2022
@machour machour changed the title [Bug]: importing sibling module via index results in unresolved dependency (undefined) importing sibling module via index results in unresolved dependency (undefined) Jul 11, 2022
@machour machour added bug:unverified and removed bug Something isn't working labels Jul 11, 2022
@machour
Copy link
Collaborator

machour commented Jan 22, 2023

Hey @akomm, Is this still a problem on Remix 1.11.1 ?

@machour machour added the needs-response We need a response from the original author about this issue/PR label Jan 22, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that are unactionable. Please reach out if you have more information for us! 🙂

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
@MichaelDeBoey MichaelDeBoey removed the needs-response We need a response from the original author about this issue/PR label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants