Can't run the latest preact example successfully
See original GitHub issueWhen I run ‘yarn start’ in preact example after installing, I met the following error:
ironman@DT:~/projects/preact$ yarn start
yarn run v1.22.5
$ react-app-rewired start
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'react'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.resolve (internal/modules/cjs/helpers.js:33:19)
at Object.<anonymous> (/home/ironman/projects/preact/node_modules/react-scripts/scripts/start.js:52:31)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
error Command failed with exit code 1.
Within the same environment, the example of styled-components and gatsby can work. This issue has tortured me for 1 day, I don’t know how to solve this problem, I look forward to advices. Thanks. BTW, the codesandbox preact example can’t work either.
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯 Continue google
Expected Behavior 🤔
Steps to Reproduce 🕹
Steps:
- curl https://codeload.github.com/mui-org/material-ui/tar.gz/next | tar -xz --strip=2 material-ui-next/examples/preact
- cd preact
- npm install or yarn install
- npm run start or yarn start
Context 🔦
Your Environment 🌎
System:
OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa) [Note: WSL 2 in Windows 10]
Binaries:
Node: 10.23.0 - ~/.nvm/versions/node/v10.23.0/bin/node [Note: I have tried using Node v14 or v15 ]
Yarn: 1.22.5 - /usr/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v10.23.0/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
@emotion/react: latest => 11.1.2
@emotion/styled: latest => 11.0.0
@material-ui/core: next => 5.0.0-alpha.18
@material-ui/styled-engine: 5.0.0-alpha.18
@material-ui/styles: 5.0.0-alpha.18
@material-ui/system: 5.0.0-alpha.18
@material-ui/types: 5.1.0
@material-ui/unstyled: 5.0.0-alpha.18
@material-ui/utils: 5.0.0-alpha.18
@types/react: 17.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
using-preact example / preact 18 compat in general does not ...
Verify canary release. I verified that the issue exists in the latest Next.js canary release. Provide environment information.
Read more >Getting Started | Preact: Fast 3kb React alternative with the ...
This guide helps you get up and running to start developing Preact apps, using 3 popular options. If you're new to Preact, we...
Read more >Getting started with PreactJS — A Step By Step Guide
Last week Jason Miller released Preact-CLI — A command line based tool ... running above mentioned command should create a new directory ...
Read more >Build a Preact App with Authentication | Okta Developer
Run Your New Preact Application! You should now be able to save your work and run npm start in the root folder and...
Read more >Preact lifecycle methods not trigger correclty in safari
when changing state of a component and then changing url, the preact component does not unmount · problem is specific to IE and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@onegrit the only solution that worked for me was downgrading the
react-script
versionLet me know if this works for you. I know it’s not the ideal solution, but wasn’t able to find anything better.
I would like to work on a pull request 😃