question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yarn unable to launch expo:web, missing package "webpack-dev-server"

See original GitHub issue

Describe the bug

  1. npx ignite-cli new IgniteExpoWebTest --bundle=com.igniteexpowebtest --git --install-deps --overwrite=false --packager=yarn --target-path=/Users/fcalise/code/IgniteExpoWebTest --remove-demo=false
  2. cd IgniteExpoWebTest
  3. yarn expo:web

Observe the following in the terminal (can ignore the bit about the port in use):

yarn expo:web
yarn run v1.22.19
$ expo start --web
Starting project at /Users/fcalise/code/IgniteExpoWebTest
› Port 19000 is running chain-react-app-2023 in another window
  /Users/fcalise/code/ChainReactApp2023 (pid 21462)
✔ Use port 19001 instead? … yes
Some dependencies are incompatible with the installed expo version:
  react-native@0.69.5 - expected version: 0.69.6
  react-native-safe-area-context@4.3.4 - expected version: 4.3.1
Your project may not work correctly until you install the correct versions of the packages.
Install individual packages by running npx expo install react-native@0.69.6 react-native-safe-area-context@4.3.1
Starting Metro Bundler
CommandError: Missing package "webpack-dev-server" in the project. Try running the command again. (cwd: /Users/fcalise/code/IgniteExpoWebTest)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

If you use the npm package manager, the project is able to start up via npm run expo:web

Ignite version

8.0.1

Additional info

System
  platform           darwin
  arch               arm64
  cpu                10 cores            Apple M1 Pro
  directory          IgniteExpoWebTest   /Users/fcalise/code/IgniteExpoWebTest

JavaScript (and globally-installed packages)
  node                16.14.2      /Users/fcalise/.nvm/versions/node/v16.14.2/bin/node
  npm                 8.5.0        /Users/fcalise/.nvm/versions/node/v16.14.2/bin/npm
    corepack          0.10.0
    eas-cli           2.1.0
    expo-cli          6.0.2
    gatsby-cli        4.21.0
    ignite-cli        8.0.1
    npm               8.5.0
    yarn              1.22.19
  yarn                1.22.19      /Users/fcalise/.nvm/versions/node/v16.14.2/bin/yarn
    create-expo-app   1.1.2
  pnpm                -            not installed
  expo                46.0.14      managed

Ignite
  ignite-cli         8.0.1        /Users/fcalise/.nvm/versions/node/v16.14.2/bin/ignite
  ignite src         src          /Users/fcalise/code/ignite/src

Android
  java               11.0.14.1    /Users/fcalise/.asdf/shims/java
  android home       -            /Users/fcalise/Library/Android/sdk

iOS
  xcode              14.0
  cocoapods          1.11.3       /opt/homebrew/bin/pod

Tools
  git                git version 2.37.0 (Apple Git-136)   /usr/bin/git

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
carlosa54commented, Oct 4, 2022

Doing yarn add webpack-dev-server@^3 -D and adding it to the repo fixed it for me. It looks like expo webpack-config uses the webpack-dev-server version 3 configuration here in the expo cli webpack.config

Edit: The expo start script loads the webpack-dev-server from the rootProject in here. I’m not sure why this works with npm and not with yarn, maybe npm is including the webpack-dev-server from another dependency

1reaction
sergioisidorocommented, Oct 4, 2022

How are you doing now after yarn add -D webpack-dev-server@^3 ?

After running the generator with :latest instead of :edge which fixed the asset issue, + adding webpack dev server, everything now works 👌

But the coincidence of a resource missing and a webpack issue made me immediately point fingers to webpack 😅 Thanks for the help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

@expo/webpack-config | Yarn - Package Manager
Welcome to @expo/webpack-config. Webpack config that's optimized for running universal React and react-native-web projects
Read more >
webpack-dev-server: command not found - Stack Overflow
I install with npm install --save-dev webpack-dev-server then I set package.json and webpack.config.js like this: setting. Then I run webpack-dev-server and ...
Read more >
Bundling with webpack - Expo Documentation
When you run npx expo start --web or expo export:web the CLI will check to see if your project has a webpack.config.js in...
Read more >
webpack-dev-server - npm
Start using webpack-dev-server in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >
Rails 6: the missing developer setup guide
bin/webpack-dev-server would be launched in parallel. ... The engines field in your package.json will verify the Yarn and Node.js versions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found