-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
When you create a new project using the Preact template, it's default dependencies are only preact and preact-compat, here's an example of what the default package.json for a new Preact template project looks like:
{
"name": "n4qn6vrz54",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"preact": "8.2.5",
"preact-compat": "3.17.0"
}
}This is a problem because as stated in the GitHub import documentation, preact-cli is required as a dependency to infer the right template to use. Without it, CodeSandbox defaults to create-react-app as it's template instead, which causes all sorts of "Could not resolve dependency 'react' realtive to..." errors. I discovered this after building a new project in CodeSandbox using the Preact template, saving it to a new repository on GitHub, which when re-imported to CodeSandbox it defaulted to the React template instead.
I would open a PR for this myself if I could find out where default dependencies are listed for each of the templates. It isn't quite clear from the source code I found under packages/common/templates/ as to where those might be located.