codesandbox / codesandbox/codesandbox-client

Why is it sometimes imported from `main` field and sometimes imported from `module` field

Open
#6,759 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

I have some dependcies compiles to es6 and other compiles to es5. So the behavior in extends of Class was broken.

How has this issue affected you? What are you trying to accomplish?

I get Class constructor Selection cannot be invoked without 'new'
I want to import file defined by main field in package.json or compile them all to es5

To Reproduce

Insert table and press backspace at the head of the next line.
image
image
image

Link to sandbox: sandbox (optional)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and repeat the table/backspace interaction described in the issue. Inspect the relevant package.json fields and trace why dependencies compiled to ES6 and ES5 select different entry fields. Done means the Selection error is resolved and the import behavior is verified for the affected dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.