Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack errors when using @expo/cli #14789

Closed
leggomuhgreggo opened this issue Feb 3, 2023 · 4 comments
Closed

webpack errors when using @expo/cli #14789

leggomuhgreggo opened this issue Feb 3, 2023 · 4 comments
Assignees
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@leggomuhgreggo
Copy link
Contributor

leggomuhgreggo commented Feb 3, 2023

Current Behavior

Running npx expo start --web, using the new @expo/cli package, throws a webpack error: ValidationError: Invalid options object related to version mismatch between webpack@4 and webpack@5.

image

The workaround, for some time, has been to run npx expo-cli start --web which uses the legacy expo-cli package, which prints a somewhat imposing warning message:
image

Expected Behavior

ability to start expo web apps using standard @expo/cli tool.

GitHub Repo

leggomuhgreggo/nx-issue-expo-babel#2

Steps to Reproduce

  1. clone, checkout repro/new-cli-not-working branch, yarn install
  2. run app with yarn nx run repro-app:run-web
  3. observe webpack error
git clone [email protected]:leggomuhgreggo/nx-issue-expo-babel.git \
  && cd $_
  && git fetch origin repro/new-cli-not-working
  && git checkout repro/new-cli-not-working
  && yarn install
  && yarn nx run repro-app:run-web

Nx Report

>  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : darwin x64
   yarn : 1.22.19
   
   nx : 15.6.3
   @nrwl/angular : Not Found
   @nrwl/cypress : Not Found
   @nrwl/detox : 15.6.3
   @nrwl/devkit : 15.6.3
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.6.3
   @nrwl/expo : 15.6.3
   @nrwl/express : Not Found
   @nrwl/jest : 15.6.3
   @nrwl/js : 15.6.3
   @nrwl/linter : 15.6.3
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.6.3
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : 15.6.3
   @nrwl/workspace : 15.6.3
   @nrwl/vite : Not Found
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

✨  Done in 0.74s.

Failure Logs

ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.node should be one of these:
   false | object { __dirname?, __filename?, global? }
   -> Include polyfills or mocks for various node stuff.
   Details:
    * configuration.node has an unknown property 'module'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dgram'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'dns'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'fs'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'http2'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'net'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'tls'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.
    * configuration.node has an unknown property 'child_process'. These properties are valid:
      object { __dirname?, __filename?, global? }
      -> Options object for node compatibility features.

Additional Information

Here's a workaround which adds a yarn resolution for webpack@4, and removes the legacy expo-cli.

Some additional context in this Nx slack thread

Thanks!

@groger
Copy link

groger commented Feb 4, 2023

same issue here ! +1

@AgentEnder AgentEnder added the scope: react-native Issues relating to React Native label Feb 7, 2023
@xiongemi
Copy link
Collaborator

submit a pr #14944 to fix this

@xiongemi
Copy link
Collaborator

this should be fixed with nx version 15.7.0

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

4 participants