codesandbox-client
codesandbox-client copied to clipboard
Cannot run `codesandbox-client` and `dependency-packager` locally together
🐛 bug report
Preflight Checklist
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
Description of the problem
I want to run codesandbox-client
and dependency-packager
locally together. Here is my steps:
-
yarn run build
andyarn run dev
underdependency-packager
project - Replace bucket url by
http://localhost:4545
at this line -
yarn run start
undercodesandbox-client
project. - When I create a React Application on
http://localhost:3000
. The terminal ofdependency-packager
report the error:
How has this issue affected you? What are you trying to accomplish?
To Reproduce
Link to sandbox: None
Your Environment
Software | Name/Version |
---|---|
Сodesandbox | master branch |
Browser | Chrome 100.0.4896.88 |
Operating System | MacOS Big Sur |
Hey @ParadeTo - It looks as though the application is looking for react 18.0.0 in. your NPM registry and not finding it, you may need to install this.
We have a guide on local installs as well (there are some aspects that need updating mind) that may be helpful: https://github.com/codesandbox/codesandbox-client/blob/master/CONTRIBUTING.md#setting-up-the-project-locally
@JamesACS I think it is because the dependency-packager
doesn't parse the right package name, then yarn add
cannot install the package.
And the guide just teach us how to start codesandbox-client
locally (the request for package still send to remote server).
Heya! Looking at this right now... I've not developed with a local version of dependency-packager
before, I've always either developed them separately or deployed the packager to a dev url on AWS to test. But we should be able to make it work I think.
What if you replace this url (https://github.com/codesandbox/codesandbox-client/blob/master/packages/sandpack-core/src/npm/preloaded/fetch-dependencies.ts#L24-L25) with the localhost:4545 url, and immediately throw an error here? https://github.com/codesandbox/codesandbox-client/blob/master/packages/sandpack-core/src/npm/preloaded/fetch-dependencies.ts#L119. That would force us to use the packager instead of the S3 cache.