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

Version 3.4.0 breaks react-native-web build #289

Closed
3 tasks done
alexandergyllensvard opened this issue Jan 9, 2025 · 4 comments
Closed
3 tasks done

Version 3.4.0 breaks react-native-web build #289

alexandergyllensvard opened this issue Jan 9, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@alexandergyllensvard
Copy link

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

After upgrading to 3.4.0 I get the following error when building my react-native app for web:

ERROR in ./node_modules/react-native-localize/dist/module/index.js 3:0-38
Module not found: Error: Can't resolve './module' in '/node_modules/react-native-localize/dist/module'
Did you mean 'module.web.js'?
BREAKING CHANGE: The request './module' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve './module' in '/node_modules/react-native-localize/dist/module'
  using description file: /node_modules/react-native-localize/dist/module/package.json (relative path: .)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: /node_modules/react-native-localize/dist/module/package.json (relative path: ./module)
      Field 'browser' doesn't contain a valid alias configuration
      /node_modules/react-native-localize/dist/module/module doesn't exist

Might be an issue for my specific setup, but noticed this specifically after upgrading this package, which have worked fine with web in previous versions (currently using 3.2.1).

Library version

3.4.0

Environment info

System:
  OS: macOS 14.6.1
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 116.90 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.12.2
    path: ~/.nvm/versions/node/v20.12.2/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: ~/.nvm/versions/node/v20.12.2/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/caretotranslate/.rvm/gems/ruby-3.1.4/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2020.3 AI-203.7717.56.2031.7621141
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.2.1
    path: /usr/local/opt/openjdk/bin/javac
  Ruby:
    version: 3.1.4
    path: /Users/caretotranslate/.rvm/rubies/ruby-3.1.4/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.4
    wanted: 0.75.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

  1. Use latest version with react-native-web

Reproducible sample code

-
@alexandergyllensvard alexandergyllensvard added the bug Something isn't working label Jan 9, 2025
@zoontek
Copy link
Owner

zoontek commented Jan 9, 2025

@alexandergyllensvard Nothing changed regarding the web module in v3.4.0. Are you bundling using webpack or expo? For me, it looks like your bundler is not correctly configured.

@alexandergyllensvard
Copy link
Author

@zoontek Thanks for the quick response. I'm building using webpack. And I have configured according to the guide you're referring to.

The same error occurs for me when upgrading from 3.2.1 to 3.3.0. The only difference in my setup is what version of react-native-localize I have installed. If there's anything I can check to help you (or me) move forward please let me know!

@zoontek
Copy link
Owner

zoontek commented Jan 9, 2025

@alexandergyllensvard I think I got it, it's an issue with react-native-builder-bob (check v3.4.1)

@alexandergyllensvard
Copy link
Author

@alexandergyllensvard I think I got it, it's an issue with react-native-builder-bob (check v3.4.1)

Can confirm this worked. Thank you so much for the quick fix!

@zoontek zoontek closed this as completed Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants