codesandbox / codesandbox/codesandbox-client
Sandboxes from CI do not resolve relative imports
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
Sandboxes generated from CI do not include dependencies.

ModuleNotFoundError
Could not find module in path: '@carbon/react/es/node_modules/use-resize-observer/polyfilled.js' relative to '/node_modules/@carbon/react/es/components/CodeSnippet/CodeSnippet.js'
In the case of this sandbox, CodeSnippet uses use-resize-observer. This dependency is declared as a dependency in packages/react.
Based on the error message I'm unsure if the use-resize-observer dependency is not in node_modules at all or if there's some other resolution issue.
How has this issue affected you? What are you trying to accomplish?
I'm trying to set up the CI for our monorepo project and this is blocking. This problem doesn't happen locally or in any other environment we've tested. I'm not sure how to resolve it.
To Reproduce
https://github.com/carbon-design-system/carbon/pull/12029#issuecomment-1231792730
Link to sandbox: link (optional)
Your Environment
| Software | Name/Version |
|---|---|
| Сodesandbox | |
| Browser | |
| Operating System |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox and the reproduction in PR #12029, then trace how CI-generated sandboxes install or package node_modules and resolve relative imports. Determine whether use-resize-observer is missing or lookup is incorrect. Done means the sandbox loads CodeSnippet without the ModuleNotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100