Skip to content

React project that works locally does not work in codesandbox #3986

@kentcdodds

Description

@kentcdodds

🐛 bug report

Description of the problem

I have this repository which is a regular react-scripts app, but when I pull it up in codesandbox I get an error about require.context. If I remove the lines that use that API, then the app will run, but then the service worker that it uses does not get loaded.

The app uses msw to simulate a backend. I'm thinking that service worker never gets loaded which causes the trouble.

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

The bookshelf app is a demo app for learning purposes. I'd love to be able to let learners use codesandbox rather than have to pull everything down themselves.

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox Codesandbox.io
Browser Chrome 81
Operating System macOS (latest)

Metadata

Metadata

Assignees

Labels

🎒 BundlerRefers to CodeSandbox's In-Browser Bundler🐛 Bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions