brumm / brumm/atom-codesandbox

infinite loop when importing package with same name as entry file

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
54
Forks
1
PR merge metrics
No merged PRs in 30d

Description

given a preview'd file 'downshift.js', having a `import Downshift from 'downshift'` statement will lock up atom.

We could either
- require local imports to always specify the full filename, including extension to differentiate between local files and named packages or
- prevent a module from importing itself or
- cache modules based on path, to support circular dependencies
we would find a module in the cache and return its contents and dependencies without having to re-read and re-parse dependencies

The last option seems like the most 'correct' approach.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.